Forum Discussion
Anonymous
3 years agoNot applicable
Need help in DAX Measure
Experts, I need your help to fix the DAX formula. The below measure should sum up all the values as denominator in the measure. Actually, I am not able to sum those values as Link ID column datatype ...
- 3 years ago
Anonymous , Try a measure like
% Link ID = divide( DISTINCTCOUNT('Query 1'[Link ID]), calculate( DISTINCTCOUNT('Query 1'[Link ID]), allselected())
https://learn.microsoft.com/en-us/dax/allselected-function-dax
- Anonymous3 years ago
Hi Anonymous,
I'd like to suggest you add a variable with summarize function to aggregate these ID at first, then you can simply summary these results to calculate with current id:
% Link ID = VAR summary = SUMMARIZE ( ALLSELECTED ( 'Query 1' ), [Category], "DC LID", DISTINCTCOUNT ( 'Query 1'[Link ID] ) ) RETURN DISTINCTCOUNT ( 'Query 1'[Link ID] ) / SUMX ( summary, [DC LID] )Regards,
Xiaoxin Sheng
Anonymous
3 years agoNot applicable
Hi Anonymous,
I'd like to suggest you add a variable with summarize function to aggregate these ID at first, then you can simply summary these results to calculate with current id:
% Link ID =
VAR summary =
SUMMARIZE (
ALLSELECTED ( 'Query 1' ),
[Category],
"DC LID", DISTINCTCOUNT ( 'Query 1'[Link ID] )
)
RETURN
DISTINCTCOUNT ( 'Query 1'[Link ID] ) / SUMX ( summary, [DC LID] )
Regards,
Xiaoxin Sheng