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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Market share by different Packs/subsegments

Hi Gurus

I am a POWER BI newbie.. and I am stuck with something rather dumb..... 

 

I have a example dataset like below 

 

MarketBrandPackValue SalesTime
XASmall100Q1'20
XALarge20Q1'20
XAX Large10Q1'20
XBLarge70

Q1'20

XBSmall20

Q1'20

 

I have a measure as below to calculate total brand market share and its working well 

 

ValShare Brand =
DIVIDE (
SUM ( MAINTABLE[Value SALES)] ),
CALCULATE ( SUM ( MAINTABLE[Value sales ] ), ALL ( MAINTABLE[BRAND] ) )
) *100
 
If I use the same formula and then on matrix I put Pack size as rows, the shares for each pack size show as a total of the total market pack size (e.g. Brand A Large out of Brand A + B Large pack size)
 
however, I want to show a chart that shows the shares by respective pack size for each brand based on TOTAL category sales, meaning Brand A Large share based on total sales of the market 
 
I am at a loss, and cant really figure it out...
 
please help!
3 REPLIES 3
v-yanjiang-msft
Community Support
Community Support

Hi @Anonymous ,

According to your description, you want the values of Pack column adds to the value of brand according to the weight of Value Sales.

vkalyjmsft_0-1656492296785.png

Here's my solution, modify your formula like this:

ValShare Brand =
DIVIDE (
    SUM ( 'MAINTABLE'[Value SALES] ),
    CALCULATE ( SUM ( 'MAINTABLE'[Value SALES] ), ALL ( 'MAINTABLE' ) )
) * 100

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

Hello! 

thanks for the reply, I tried this but ended up getting 100% as a result for all brands 😞 

 

tbj2009_0-1656753213390.png

Could it be because of my relationships of tables?

please see below, I have relationships to Date table and a separate pack size table from the main table. Teh separate packsize table just helps me club several packs into custom labels

tbj2009_1-1656753275588.png

 

amitchandak
Super User
Super User

@Anonymous , You might have to create two measures and switch using isinscope

https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

 

similar example

IsInScope - Switch Rank at different levels: https://youtu.be/kh0gezKICEM

 

ValShare pack size=
DIVIDE (
SUM ( MAINTABLE[Value SALES)] ),
CALCULATE ( SUM ( MAINTABLE[Value sales ] ), ALL ( MAINTABLE[Pack Size] ) )
) *100

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.