Forum Discussion
Calculate Market Share in Matrix
Hi Anonymous
You can create a Measure to get the result you want.
Market share =
VAR total_item =
CALCULATE ( SUM ( UPCData[Sales] ), ALLEXCEPT ( UPCData, UPCData[Item] ) )
VAR total_market_set =
CALCULATE ( SUM ( UPCData[Sales] ), ALLEXCEPT ( UPCData, UPCData[Market Set] ) )
RETURN
IF (
HASONEVALUE ( UPCData[Item] ),
IF (
HASONEFILTER ( UPCData[Market Set] ),
SELECTEDVALUE ( UPCData[Sales] ) / total_item,
1
),
total_market_set / total_item
)
The result looks like this:
For more details, you can refer the attached pbix.
Best Regards,
Caiyun Zheng
Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous5 years agoNot applicable
Thank you very much...this works perfectly for the purposes of what I had posted.
One thing I did not show is that I have additional filters from the same UPCDATA table for Geography, Category, Brand, Package Shape and Size. When I tried to start adding them to the HASONEFILTER line I got an error. Any help on how to make this work on all the filters on the page?
- v-cazheng-msft5 years ago
Community Support
- Anonymous5 years agoNot applicable