Forum Discussion
Market share(%) by category
- 7 years ago
junoglasgow Please try below:
Add "New Table"
MarketBrandOutput = SUMMARIZE(MarketBrand,MarketBrand[Brand],MarketBrand[MarketSegment],"MarkSegTotal",SUM(MarketBrand[Qty]))
Add two additional fields using "New Column" option as below
BrandTotal = CALCULATE(SUM(MarketBrandOutput[MarkSegTotal]),FILTER(ALL(MarketBrandOutput),MarketBrandOutput[Brand]=EARLIER(MarketBrandOutput[Brand])))
Share% = DIVIDE(MarketBrandOutput[MarkSegTotal],MarketBrandOutput[BrandTotal])
Finally, your output will look like this...
Just representing the above data in Matrix visual, for your reference
junoglasgow Just to confirm, the expected output (the last two tabular data) is not aligned with the sample data. It just sample layout that you are expecting isn't it ?
PattemManohar appreciate your reply, You are right. I created tabular tables just to demonstrate how the bar chart should look like. these are not aligned with the sample data.
- PattemManohar7 years ago
Community Champion
junoglasgow Thanks for confirming that.
Please try this for your 1st Requirement, by using "New Table" option
MarketShareByBrand = SUMMARIZECOLUMNS(MarketBrand[MarketSegment],MarketBrand[Brand],"Total",SUM(MarketBrand[Qty]))
Then in the chart visual, change the "Value" field to "Show Value as -> Percent of Grand Total". You can have one chart and a slicer on Brand instead of having different charts for each brand. If you want different charts for each brand, then have a "Visual Level Filter"
- junoglasgow7 years agoFrequent Visitor
Appreciate your help, I Try it but it keep saying that "The expression refers to multiple columns, Multiple columns cannot be converted to a scalar value.
I try this "New measure" option
- PattemManohar7 years ago
Community Champion
junoglasgow As mentioned above, please try using "New Table" option