To complete this recipe, do the following:
- Create the following measures:
AllSum = SUMX(ALL('R04_Table'),'R04_Table'[Value])
NormalSum = SUM('R04_Table'[Value])
InverseSum =
IF(
ISFILTERED('R04_Table'[Category]),
CALCULATE(
SUM('R04_Table'[Value]),
EXCEPT(
ALL('R04_Table'[Category]),
VALUES('R04_Table'[Category])
)
),
SUM('R04_Table'[Value])
)
- On a Report page, create a Slicer visualization and place the Category column from the R04_Table table into the Fields area.
- On the same Report page, create a Table visualization and place the Category and Value columns from the R04_Table table into the Values area.
- On the same Report page, create a Card visualization and place the AllSum measure into the Fields area.
- On the same Report page, create a second Card visualization and place the NormalSum measure into the Fields area.
- On the same Report page, create a third Card visualization and place the InverseSum measure into the Fields area.
The AllSum measure always displays the total amount of the Value column for all items in the table. The NormalSum measure displays the sum of the Value column for all items selected in the Slicer visualization. The InverseSum measure displays the sum of the Value column for all items not selected in the Slicer visualization. The sum of NormalSum and InverseSum always equals the value of AllSum.