Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I was wondering if there was possible to count the result of a measure?
I have one fact table that contains:
ID_1 | ID_2
123 123
456 456
789 987
654 321
As you can see some of the ID 1 and ID 2 are the same, and some are diffrent.
I then have a measure like this:
measure =
VAR ID1 = SUM ( 'Table'[ID_1] )
VAR ID2 = SUM ( 'Table'[ID_2] )
VAR Result = IF ( ID1 <> ID2; 1; 0 )
RETURN
Result
Now I want to count or sum how many has 1 and how many has 0.
I know I can make a calculated column in DAX and then use COUNTROWS, but I was wondering if its possible to solve this with a measure?
Let me know if you need more information or if something is unclear.
Thanks,
Marius
Solved! Go to Solution.
Hi @Anonymous,
Based on my test, you could refer to below measures:
sum equals to 0 = COUNTROWS(FILTER('Table','Table'[measure]=0))
sum equals to 1 = COUNTROWS(FILTER('Table','Table'[measure]=1))
Result:
Regards,
Daniel He
Hi @Anonymous,
Based on my test, you could refer to below measures:
sum equals to 0 = COUNTROWS(FILTER('Table','Table'[measure]=0))
sum equals to 1 = COUNTROWS(FILTER('Table','Table'[measure]=1))
Result:
Regards,
Daniel He
Should be able to do something along the lines of:
Measure 2 = SUMX(SUMMARIZE('Table',[ID_1],"__Measure",[measure]),[__Measure])
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
97 | |
78 | |
63 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |