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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.