How to do it...

To implement this recipe, do the following:

  1. Create the following measure:
ABC = 
VAR __ProductID = MAX('R01_Products'[ProductID])
VAR __Table =
GROUPBY(
ALLSELECTED('R01_Sales'),
'R01_Sales'[ProductID],
"__Sales",SUMX(CURRENTGROUP(),'R01_Sales'[SaleTotal])
)
VAR __TotalSales = SUMX(__Table,[__Sales])
VAR __Table1 =
ADDCOLUMNS(
ADDCOLUMNS(
__Table,
"__RunningSales%",
VAR __Percent = 1 -
SUMX(
FILTER(__Table,
[__Sales]<=EARLIER([__Sales])
),
[__Sales] / __TotalSales)
RETURN
IF(__Percent < 0,0,__Percent)
),
"__ABC Class",
SWITCH(
TRUE(),
[__RunningSales%] <.8,"A",
[__RunningSales%]<.95,"B",
"C"
)
)
RETURN
MAXX(
FILTER(
__Table1,
[ProductID] = __ProductID
),
[__ABC Class]
)
  1. On the same Report page, create a Table visualization and place the Name column from the R01_Products table into the Values area of the visualization. Also, place the ABC measure into the Values area of the visualization.
  2. On a Report page, create a Slicer visualization and place the Name column from the R01_Categories table into the Field area of the visualization.
  3. On the same Report page, create a second Slicer visualization and place the Name column from the R01_SubCategories table into the Field area of the visualization.