cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Trolleri
Helper I
Helper I

Calculate market share in category

Hello!

 

I have a table with with products and sales where the products are in different categories and have different manufacturers. 

 

I have a table visual where i can filter on manufacturer and see the sales but what i would like is to have the market share for all the products in their respective category despite the filtered manufacturer.

Right now if i select 3 categories and 1 manufacturer, the %share only shows the share for the total amount of the products listed in the visual.

So i would like to take (sales for that product) divided by the total sales in that products category no matter which categories are filtered and by all manufacturers no matter which manufacturer is filtered.

 

Im sure there is an easy way to do this but i cant figure it out right now..

 

1 ACCEPTED SOLUTION
TeigeGao
Solution Sage
Solution Sage

Hi @Trolleri ,

In your scenario, we can use ALL() to remove all filters to get the total sales amount, please refer to the following DAX query:

Measure = DIVIDE(SUM(Table1[Sales]),CALCULATE(SUM(Table1[Sales]),ALL(Table1)))

The result will like below:

PBIDesktop_1Pk75Ztipr.png

Best Regards,

Teige

View solution in original post

1 REPLY 1
TeigeGao
Solution Sage
Solution Sage

Hi @Trolleri ,

In your scenario, we can use ALL() to remove all filters to get the total sales amount, please refer to the following DAX query:

Measure = DIVIDE(SUM(Table1[Sales]),CALCULATE(SUM(Table1[Sales]),ALL(Table1)))

The result will like below:

PBIDesktop_1Pk75Ztipr.png

Best Regards,

Teige

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors