Calculate Percent of Total For Pivot Table

I am trying to calculate the percent of each value ( in the picture) from the total value ( For example the total is 50). I have this formula and I get an error because I am not grouping the level aware calculations by the same grouping key. The pivot table is grouped by state and Quarter and then I want to calculate the percent for each value of the grand total

Formula = distinct_count({ID},[{State}]) / distinct_count({ID},[])

Hi @selam_tekie ,
Can you try using table calculation “Percent of total” on pivot table ? similar to steps in this excercise - Refer Exercise # 12 .

Does this answer your question? If so, please help the community out by marking this answer as ‘Solution.’

NL-CL-12

1 Like

Hi @Neeraj Thank you, but I don’t have the Percent of Total option on my Quicksight account.

I was able to fix it by creating another calculated field and then aggregating as SUM to use the Quicksight Pivot table example of calculating Total of Percent @Neeraj provided.

Calculated field = distinct_count({ID},[{State},{City}])