The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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:
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.
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
Solved! Go to Solution.
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]))
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:
Your welcome:-)
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]))
User | Count |
---|---|
17 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
9 | |
8 |