Forum Discussion
Help with Market Share calculation in DAX
- Anonymous2 years ago
Thanks for the reply from Ritaf1983.
Hi javif_84 ,
Please try the following DAX formula:
LAST MAT MS%1 = DIVIDE([LAST MAT],CALCULATE([LAST MAT],ALLSELECTED('Output')))Result:
Best Regards,
ZhuIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
OK sorry even in this dataset the formula does not work which is great 🙂
Absolute figures and MS
This is what I get in Excel
Thanks for the reply from Ritaf1983.
Hi javif_84 ,
Please try the following DAX formula:
LAST MAT MS%1 = DIVIDE([LAST MAT],CALCULATE([LAST MAT],ALLSELECTED('Output')))
Result:
Best Regards,
Zhu
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- javif_842 years ago
Helper I
Thanks so much Zhu! One question, what was the issue? Why a sumx wasn t giving me the proper result?
- Anonymous2 years agoNot applicable
Hi javif_84 ,
In DAX, measure is computed based on context, which means that they determine their values based on the current filter conditions and the context. Directly referencing a measure ensures that it is calculated correctly in the current context. SUMX function is an iterative function that calculates and sums each row in a table. Using SUMX function is summing each row. But the calculation of the measure depends on the context of the entire visual rather than a single row of data.
Best Regards,
ZhuIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.