Forum Discussion
How to control the slicers?
- 4 years ago
Hi bourne2000
As you've noted, the built-in "Percent of grand total" calculation calculates the total based on the overall filter context of the visual (using ALLSELECTED in the DAX query generated).
To calculate % of total for all Categories including those not displayed, you will need to create explicit measures and use REMOVEFILTERS or ALL.
I recommend creating:
Amount Sum = SUM ( YourTable[Amount] )Amount % of total = DIVIDE ( [Amount Sum], CALCULATE ( [Amount Sum], REMOVEFILTERS ( YourTable[Category] ) ) )(applying a percentage format to the second measure).
Does this work for you?
Regards,
Owen
Hi bourne2000
As you've noted, the built-in "Percent of grand total" calculation calculates the total based on the overall filter context of the visual (using ALLSELECTED in the DAX query generated).
To calculate % of total for all Categories including those not displayed, you will need to create explicit measures and use REMOVEFILTERS or ALL.
I recommend creating:
Amount Sum =
SUM ( YourTable[Amount] )Amount % of total =
DIVIDE (
[Amount Sum],
CALCULATE (
[Amount Sum],
REMOVEFILTERS ( YourTable[Category] )
)
)
(applying a percentage format to the second measure).
Does this work for you?
Regards,
Owen