Forum Discussion
DAX - countif after grouping
- 8 years ago
Hi Celador
Try these MEASURES as well
Red = COUNTROWS ( FILTER ( SUMMARIZE ( Table1, Table1[UserId], Table1[ResponseId], Table1[Result] ), Table1[Result] = "Red" ) )And
Blue = COUNTROWS ( FILTER ( SUMMARIZE ( Table1, Table1[UserId], Table1[ResponseId], Table1[Result] ), Table1[Result] = "Blue" ) )
Hi Abduvali
Apologies, I initially marked this as the solution, but it doesn't appear to resolve the issue of grouping by UserId and ResponseId before performing the Count. I was a little presumptious because the measure actually produced results, where all my other attempts have so far just generated errors! :) :)
Your solution looks like it would generate the following:
Measure #1 - 7
Measure #2 - 6
Instead of 3 & 2
Yes it will give you 6 and 7 unless you will group them by UserID once grouped it will give you 2 and 3
- Do you know how to use grouping in Power BI?
- Celador8 years agoFrequent Visitor
Abduvali Not really, I have a rough understanding of the SUMMARIZE function - which is what I thought I would need, but not enough to generate the answer I'm after.
Sorry if i wasn't clear in the original post, it's the combination of grouping by those columns, followed by the count that I'm struggling with.