Percentage calculation

更新时间:
复制 MD 格式

Percentage calculation quickly computes a data point's proportion of a total. This helps you understand how a specific value contributes to the overall dataset. This topic describes how to configure percentage calculations.

Prerequisites

Usage notes

  • The following chart types support percentage calculation.

    Calculation type

    Description

    Supported chart types

    Percentage of total

    Calculates a data point's value as a percentage of all values in the dataset. For example, it calculates January sales as a percentage of total annual sales.

    • Line/area charts: line chart, area chart, stacked area chart, 100% stacked area chart, and combo chart.

    • Column/bar charts: column chart, stacked column chart, 100% stacked column chart, radial bar chart, leaderboard, bar chart, stacked bar chart, 100% stacked bar chart, waterfall chart, bullet chart, box plot, and histogram.

    • Bubble/scatter charts: bubble chart, scatter chart, and faceted scatter chart.

    • Pie/ring charts: radar chart.

    • Table charts: crosstab.

    • Geographic charts: filled map, bubble map, heat map, flow map, and symbol map.

    • Indicator charts: indicator card and indicator trend chart.

    • Other charts: word cloud.

    Percentage in group

    Calculates a data point's value as a percentage of its group total. For example, it calculates January sales as a percentage of total sales for the first quarter.

    • Line/area charts: line chart, area chart, stacked area chart, 100% stacked area chart, and combo chart.

    • Column/bar charts: column chart, stacked column chart, 100% stacked column chart, bar chart, stacked bar chart, 100% stacked bar chart, bullet chart, box plot, and histogram.

    • Bubble/scatter charts (the X-axis cannot be a measure): bubble chart, scatter chart, and faceted scatter chart.

    • Table charts: crosstab.

    Note

    Pie charts, rose charts, treemaps, funnel charts, and comparison funnel charts have built-in support for displaying percentages. Therefore, the percentage calculation option is not available for these chart types in the Advanced Calculation menu.

Configuration

In the Fields panel of the chart, locate the measure for which you want to calculate the percentage. Click the image icon next to it, and in the drop-down list, select Advanced Calculation > Percentage. Then, configure the percentage type based on your business scenario.

image

The percentage calculation types available for a crosstab are different from those for other chart types, as described in the following table.

Chart type

Calculation type

Limitation

Calculation logic

Crosstab

Percentage of Grand Total

Available only when both rows and columns contain fields.

Calculates the value of the current data point as a percentage of the grand total.

Percentage of column total

The Rows area contains a dimension field.

Treats each column as a separate unit and calculates the value of a data point as a percentage of the column total.

Percentage in column group

The Rows area contains two or more dimension fields.

Groups the data by the finest-grained dimension in the Rows area and calculates the value of the current data point as a percentage of its group total.

To specify a grouping dimension, select the Custom calculation type.

image

Percentage of row total

The Columns area contains a dimension field.

Treats each row as a separate unit and calculates the value of a data point as a percentage of the row total.

Percentage in row group

The Columns area contains two or more dimension fields.

Groups the data by the finest-grained dimension in the Columns area and calculates the value of the current data point as a percentage of its group total.

To specify a dimension for grouping, select the Custom calculation type.image

Cumulative percentage

Cumulative percentage of column

The Rows area contains a dimension field.

Treats each column as a separate unit and calculates the cumulative percentage of data points from top to bottom.

Cumulative percentage in column group

The Rows area contains two or more dimension fields.

Groups the data by the finest-grained dimension in the Rows area and calculates the cumulative percentage of data points within each group from top to bottom.

To specify a dimension for grouping, select the Custom calculation type.

image

Cumulative percentage of row

The Columns area contains a dimension field.

Treats each row as a separate unit and calculates the cumulative percentage of data points from left to right.

Cumulative percentage in row group

The Columns area contains two or more dimension fields.

Groups the data by the finest-grained dimension in the Columns area and calculates the cumulative percentage of data points within each group from left to right.

To specify a dimension for grouping, select the Custom calculation type.

image

Custom

Percentage of Grand Total

Available only when both rows and columns contain fields.

Calculates the value of the current data point as a percentage of the grand total.

Percentage of column total

The Rows area contains a dimension field.

Treats each column as a separate unit and calculates the value of a data point as a percentage of the column total.

Percentage in column group

The Rows area contains two or more dimension fields.

Groups the data by the selected dimension and calculates the value of the current data point as a percentage of its group total.

The grouping logic includes all dimensions from the first dimension in the Rows area to the selected grouping dimension. For example, in the following figure, the data is grouped by the area and province fields.

image

Percentage of row total

The Columns area contains a dimension field.

Treats each row as a separate unit and calculates the value of a data point as a percentage of the row total.

Percentage in row group

The Columns area contains two or more dimension fields.

Groups the data by the selected dimension and calculates the value of the current data point as a percentage of its group total.

The grouping logic includes all dimensions from the first dimension in the Columns area to the selected grouping dimension. For example, in the following figure, the data is grouped by the product_type field.image

Cumulative percentage of column

The Rows area contains a dimension field.

Treats each column as a separate unit and calculates the cumulative percentage of data points from top to bottom.

Cumulative percentage in column group

The Rows area contains two or more dimension fields.

Groups the data in each column by the selected dimension and calculates the cumulative percentage within each group from top to bottom.

The grouping logic includes all dimensions from the first dimension in the Rows area to the selected grouping dimension. For example, in the following figure, the data is grouped by the area and province fields.image

Cumulative percentage of row

The Columns area contains a dimension field.

Treats each row as a separate unit and calculates the cumulative percentage of data points from left to right.

Cumulative percentage in row group

The Columns area contains two or more dimension fields.

Groups the data in each row by the selected dimension and calculates the cumulative percentage within each group from left to right.

The grouping logic includes all dimensions from the first dimension in the Columns area to the selected grouping dimension. For example, in the following figure, the data is grouped by the product_type field.image

Other charts

Percentage of total

N/A

Calculates the value of the current data point as a percentage of the total.

Percentage in group

  • A dimension field is in the Color Legend or Split area.

  • For bubble charts and scatter charts, the X-axis cannot be a measure.

Groups the data by the dimension field and calculates the value of a data point as a percentage of its group total.

The grouping logic is as follows:

  • If a dimension is in the Color Legend area but not in the Split area, the data is grouped by the dimension in the Color Legend area.

  • If a dimension is in the Split area but not in the Color Legend area, the data is grouped by the dimension in the Split area.

  • If both areas contain dimensions, the data is grouped by all dimensions in both areas.

Examples

The following examples demonstrate how percentage calculations work.

Example 1: Column chart

This example shows how to configure a percentage calculation for a column chart.

  1. Log on to the Quick BI console.

  2. Follow the steps in the figure to open the dashboard edit page.image.png

  3. In the top menu bar, click Add Chart and select Column Chart.image.png

  4. On the Fields tab of the data panel, configure the data fields for the column chart and click Update.image

  5. Find the measure for which you want to calculate the percentage. Click the image icon next to it and select Advanced Calculation > Percentage. Quick BI calculates the percentage based on the fields in the Color Legend and Split areas of the Fields tab and the selected calculation type. The following table provides examples for different scenarios.

    Field configuration

    Selected calculation type

    Example

    No dimension fields are in the Color Legend and Split areas.

    Only Percentage of total is available.

    Calculates the value of a data point as a percentage of the total. For example, the order amount for the Northeast region as a percentage of the total order amount.

    image

    • The Color Legend area contains the product_type field.

    • The Split area is empty.

    Percentage of total

    Calculates the value of a data point as a percentage of the total. For example, the order amount for office supplies in the Northeast region as a percentage of the total order amount.

    image

    Percentage in group

    The data is grouped by the product_type field.

    Calculates the value of a data point as a percentage of its group total. For example, the order amount for office supplies in the Northeast region as a percentage of the total order amount for the Northeast region.

    image

    • The Color Legend area is empty.

    • The Split area contains the shipping_method field.

    Percentage of total

    Calculates the value of a data point as a percentage of the total. For example, the order amount for truck shipping in the Northeast region as a percentage of the total order amount.

    image

    Percentage in group

    The data is grouped by the shipping_method field.

    Calculates the value of a data point as a percentage of its group total. For example, the order amount for truck shipping in the Northeast region as a percentage of the total order amount for all truck shipping.

    image

    • The Color Legend area contains the product_type field.

    • The Split area contains the shipping_method field.

    Percentage of total

    Calculates the value of a data point as a percentage of the total. For example, the order amount for office supplies shipped by truck in the Northeast region as a percentage of the total order amount.

    image

    Percentage in group

    The data is grouped by the product_type and shipping_method fields.

    Calculates the value of a data point as a percentage of its group total. For example, the order amount for office supplies shipped by truck in the Northeast region as a percentage of the total order amount for the Northeast region.

    image

Example 2: Crosstab

The percentage calculation types available for a crosstab are different from those for other chart types. The following table provides examples.

Calculation type

Configuration

Example

Percentage of Grand Total

Available only when both rows and columns contain fields. In this example, the Columns area contains both dimensions and measures.

Calculates the value of the current data point as a percentage of the grand total. For example, the order amount for office supplies in the Northeast region as a percentage of the total order amount.image

Percentage of column total

In this example, percentages are calculated by column.

Calculates a data point's value as a percentage of its column total. For example, the order amount for office supplies in the Northeast region as a percentage of the total order amount for all office supplies.image

Percentage in column group

In this example, data is grouped by province, which is the finest-grained dimension in the Rows area.

Calculates the value of the current data point as a percentage of its column group total. For example, the order amount for Jilin province as a percentage of the total order amount for the Northeast region.

image

Percentage of row total

In this example, percentages are calculated by row.

Calculates a data point's value as a percentage of its row total. For example, the percentage breakdown of the total order amount in Tonghua city by product type.image

Percentage in row group

In this example, data is grouped by shipping_method, which is the finest-grained dimension in the Columns area.

Calculates the value of the current data point as a percentage of its row group total. For example, the order amount for office supplies shipped by truck as a percentage of the total order amount for all office supplies.

image

Cumulative percentage

Cumulative percentage of column

In this example, the cumulative total is calculated for each column from top to bottom.

Calculates the cumulative percentage of data points for each column from top to bottom. For example, calculating the cumulative percentage for each region from top to bottom.image

Cumulative percentage in column group

In this example, data is grouped by province, which is the finest-grained dimension in the Rows area.

Calculates the cumulative percentage of data points for each group from top to bottom based on the grouping dimension. For example, calculating the cumulative percentage for each province within the Northeast region.

image

Cumulative percentage of row

In this example, the cumulative total is calculated for each row from left to right.

Calculates the cumulative percentage of data points for each row from left to right. For example, calculating the cumulative percentage for each product type from left to right.image

Cumulative percentage in row group

In this example, data is grouped by shipping_method, which is the finest-grained dimension in the Columns area.

Calculates the cumulative percentage of data points for each group from left to right based on the grouping dimension. For example, calculating the cumulative percentage of the order amount for each shipping method within office supplies.image

Custom

Percentage of Grand Total

Available only when both rows and columns contain fields. In this example, the column area contains both dimensions and measures.

Calculates the value of the current data point as a percentage of the grand total. For example, the order amount for office supplies shipped by truck in the Northeast region as a percentage of the total order amount.

image

Percentage of column total

In this example, percentages are calculated by column.

Treats each column as a separate unit and calculates the value of a data point as a percentage of the column total. For example, the order amount for Jilin city as a percentage of that column's total order amount.

image

Percentage in column group

In this example, the first dimension in the Rows area is area, and the grouping dimension is province. Therefore, the data is grouped by the area and province fields, and percentages are calculated within each province.

Calculates the value of the current data point as a percentage of its column group. For example, the percentage of the total provincial order amount contributed by each city.

image

Percentage of row total

In this example, percentages are calculated by row.

Treats each row as a separate unit and calculates the value of a data point as a percentage of the row total. For example, the order amount for truck shipping in the Northeast region as a percentage of the total order amount for the Northeast region.image

Percentage in row group

In this example, the first dimension in the Columns area and the selected grouping dimension are both product_type. Therefore, the data is grouped by the product_type dimension, and percentages are calculated within each product type.

Calculates the value of the current data point as a percentage of its row group. For example, the percentage of the total order amount for a product type contributed by each shipping method.image

Cumulative percentage of column

In this example, the cumulative total is calculated for each column from top to bottom.

Treats each column as a separate unit and calculates the cumulative percentage of data points from top to bottom. For example, calculating the cumulative percentage of the order amount for each city from top to bottom.image

Cumulative percentage in column group

In this example, the first dimension in the Rows area is area, and the grouping dimension is province. Therefore, the data is grouped by the area and province fields.

Groups the data in each column by the province dimension and calculates the cumulative percentage within each group from top to bottom. For example, calculating the cumulative percentage of the order amount for each city within its province's total order amount.

image

Cumulative percentage of row

In this example, the cumulative total is calculated for each row from left to right.

Treats each row as a separate unit and calculates the cumulative percentage of data points from left to right. For example, calculating the cumulative percentage of the order amount for different shipping methods within each product type from left to right.image

Cumulative percentage in row group

In this example, the first dimension in the Columns area and the selected grouping dimension are both product_type. Therefore, the data is grouped and the percentage is calculated based on the product_type dimension.

Groups the data in each row by the selected product type dimension and calculates the cumulative percentage within each group from left to right. For example, calculating the cumulative percentage of the order amount for each shipping method within the office supplies order amount.image