Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
junoglasgow
Frequent Visitor

Market share(%) by category

Hi

 

I am trying to make the bar charts show Market share by each market segment. I have looked up all post but could not find a good case I am looking for. It would be much appreciated if you could help me to work out!

 

Condition: There are 5 market segments and multiple brands competing in each market segment. The data table is as below

 

 

Market SegmentBrandQty Sold
EntryA2
MainB3
HighC11
PremiumD23
LuxuryE11
EntryE2
PremiumD33
LuxuryA11
LuxuryC3
LuxuryC4
HighC1
HighF2
EntryE3
HighC11
EntryA9
EntryG2
EntryH2
EntryI2
HighC1
EntryF2
EntryE3
HighC11
EntryA9

 

Question

1. I want to make a bar chart shows category market share(%) by brand as below (in a bar chart) 

 

Chart1BrandA Chart1BrandB Chart1BrandC Chart1BrandD
Entry65% Entry0% Entry0% Entry0%
High0% High0% High83% High0%
Luxury35% Luxury0% Luxury17% Luxury0%
Main0% Main100% Main0% Main0%
Premium0% Premium0% Premium0% Premium100%


2. I want to make a bar chart shows category market share(%) by brand and by Ranking 

 * Ranking: Ranking based on total number of Qty sales in total (Sum of all product category: Entry, Main, High, Premium, Luxury)

 

Chart1BrandD Chart1BrandC Chart1BrandA Chart1BrandE
Entry0% Entry0% Entry65% Entry42%
High0% High83% High0% High0%
Luxury0% Luxury17% Luxury35% Luxury58%
Main0% Main0% Main0% Main0%
Premium100% Premium0% Premium0% Premium0%
1 ACCEPTED SOLUTION

@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...

 

image.png

 

Just representing the above data in Matrix visual, for your reference

 

image.png





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




View solution in original post

8 REPLIES 8
junoglasgow
Frequent Visitor

I fixed the example table, now they are in line with with data

Can Anyone help me out this, please?

@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...

 

image.png

 

Just representing the above data in Matrix visual, for your reference

 

image.png





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




PattemManohar
Community Champion
Community Champion

@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 ? 





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




@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.

 

@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"

 

image.png

 

 

 

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




@PattemManohar

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

@junoglasgow As mentioned above, please try using "New Table" option




Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




@PattemManohar

I made it as guided but it only shows % of Grand total. I want to see % of subtotal for a specific brand.

For example, Brand A market share 74% in Entry / Brand A Market share 34% in Luxury / 85% market share in Premium etc..

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.