Using example sales data with two hierarchies, Region and Category.
Region:
North
East
South
West
Category:
Shoes
Hats
Shirt
Pants
I am using a small multiple that displays Sales $ By Category for every Region
so the north section looks like:
Region North
Shoes 1K
Hats 3K
Shirt 8K
Pants 10K
This works fine, however, next to the $Amt, I also need to display the % each category is of the Pants Category.
I create a calculated measure PantsOnlyAmt:
if ($Category$ == ‘Pants’)
{ return $Amt$;}
else
{ return 0;}
And another calculated measure: Amt as % of Pants Amt
$Amt/SUM($PantsOnlyAmt$)
Because the PantsOnlyAmt only has a value in the Pants line, I need to do the SUM so that I can access that amount from all the other categories.
This works correctly in a dashboard with a table and a Region filter, but it is not working in the Small Multiple because the SUM($PantsOnlyAmt$) seems to be retrieving all of the Pants categories across ALL regions.
Is there a way around this behavior? I’m guessing I could create the calculated PantsOnlyAmt in the data cube and it would work, but wondering if there is another way in the small multiple. Can anyone explain what is going on behind the scenes with filtering in the Small Multiple? Since the Region field has to be a the ROW level, is there a way to specify in my PantsOnlyAmt calculation to only take the records with the “current region”?
Hope that makes sense with the strange example data situation. Thanks.