Amazon QuickSight
User Guide

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.

percentOfTotal

percentOfTotal calculates the percentage a measure contributes to the total, based on the dimensions specified.

percentOfTotal is supported for use with analyses based on SPICE and direct query data sets.

Syntax

The brackets are required. To see which arguments are optional, see the following descriptions.

percentOfTotal ( measure ,[ partition_field, ... ] )

Arguments

measure

An aggregated measure that you want to see the percent of total for. (Currently, the distinct count aggregation is not supported for percentOfTotal.)

partition field

(Optional) One or more dimensions that you want to partition by, separated by commas.

Each field in the list is enclosed in {} (curly braces), if it is more than one word. The entire list is enclosed in [ ] (square brackets).

Example

The following example creates a calculation for the percent of total Sales contributed by each State.

percentOfTotal ( sum(Sales), [State] )

The following example calculates the percent that a specific Billed Amount is when compared to the total Billed Amount, partitioned by ([{Service Line} ASC]). This example uses the revenue sample dataset, located in an Amazon S3 bucket. The fields in the table calculation are in the field wells of the visual.

percentOfTotal ( sum( {Billed Amount} ), [{Service Line}] )

The following screenshot shows the results of the example. The red highlights show that the partition field with the value "Billing" has three entries, one for each region. The total billed amount for this service line is divided into three percentages, which total 100 percent. Percentages are rounded and might not always add up to exactly 100 percent.

On this page: