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.
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])