Forum Discussion
Creating a market share
- 7 years ago
Anonymous
Create a measure like the following:
% Share = VAR Volume = SUM('Table'[Sales]) VAR AllVolume = CALCULATE ( SUM('Table'[Sales]),ALL('Table'[Calcuated_Column]) ) RETURN DIVIDE ( Volume, AllVolume )And then create a new Table object and add your calculated column as dimension and next to it add then above measure
Anonymous
Then Product will be displayed as a slicer where you can select the product you want.
Then on the table object you will add the category field (as dimension) which contains all categories across all products and also add similar measure which will look like this:
% Share =
VAR Volume =
SUM('Table'[Sales])
VAR AllVolume =
CALCULATE ( SUM('Table'[Sales]),ALL('Table'[Category]) )
RETURN
DIVIDE ( Volume, AllVolume )
Maybe I'm not making myself clear. Let me try to explain.
Your measure is perfect when calculating the market share of the products that i have in the calculated column.
But when i add a slicer with the products from the calculated column and select any of them, the measure shows the share of the product/the share of the same product, which will always be 100%, when the denominator should be the whole market in that category.
- themistoklis7 years agoCommunity Champion
Anonymous
I dont see the same behaviour when i recreate it on PowerBI.
When i select something from the slicer then the table shows me the share of this product across all the products and not of its own.
Any chance to share your file or show with couple of images the desired output?
- Anonymous7 years agoNot applicable
themistoklis Thanks, but i've managed to work it out, by adding an "ALL Filter in the calculation of the category.
Thank you again for your time!