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},[])

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}])