Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
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
Can we create the measure so that can be used on bar chart on Y -axis, basically that will count the rows having the 0 and 1 in one measure and we can create the bar chart ?
Should be able to do something along the lines of:
Measure 2 =
SUMX(SUMMARIZE('Table',[ID_1],"__Measure",[measure]),[__Measure])
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 58 | |
| 52 | |
| 40 | |
| 17 | |
| 16 |
| User | Count |
|---|---|
| 112 | |
| 108 | |
| 39 | |
| 34 | |
| 27 |