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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
JanCab
Frequent Visitor

Calculating share of sales of specific product

Hi, I am trying to create a DAX calculation which will display a share of a product on another product flagged as market leader.

 

Basically, this is it:

JanCab_0-1647279624162.png

Products are filtered based on slicers/categories but it is not a problem. I could calculate the % based on column total, but closest I got in this time was here - values are calculated only for Market Leader.

 

JanCab_1-1647279811168.png

I use this DAX:

=DIVIDE(
SUM (T_DATA[Value]);
CALCULATE( SUM (T_DATA[Value]);
T_DATA[T_LOV_Product.Competition]=2;
ALLSELECTED(T_LOV_Product)

))

 

Thank you very much indeed. 

Jan

 

 

1 ACCEPTED SOLUTION
Whitewater100
Solution Sage
Solution Sage

Hello:

Assuming you have the measure for market leader, I'll name it [Market Leader Sales]

You can try

Share of Mkt Leader = 

DIVIDE(SUMX(T_Data, T_Data[Value]),

CALCULATE([Market Leader Sales], ALLEXCEPT('T_Data[YYYY_MM]))

View solution in original post

3 REPLIES 3
JanCab
Frequent Visitor

Thank you very much! 

ALLEXCEPT did not even cross my mind.

Just for somebody who may follow up the final code I used + if necessary add filtering into ALLEXCEPT:

 

Share of Mkt Leader 2 =
DIVIDE(SUMX(T_Data, T_Data[Value]),
CALCULATE([Market Leader Sales],
ALLEXCEPT(T_DATA,T_DATA[YYYY_MM])))

Your welcome:-)

Whitewater100
Solution Sage
Solution Sage

Hello:

Assuming you have the measure for market leader, I'll name it [Market Leader Sales]

You can try

Share of Mkt Leader = 

DIVIDE(SUMX(T_Data, T_Data[Value]),

CALCULATE([Market Leader Sales], ALLEXCEPT('T_Data[YYYY_MM]))

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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