The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 in text. Below is the measure written with hardcoded value, but I would like to see that in dynamically should sum up in denominator.
Thanks,
Bala
Solved! Go to Solution.
@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
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
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 , 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
User | Count |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
36 | |
14 | |
12 | |
7 | |
7 |