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" ) )
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.
See below on how to group your table to get to desired table look:
Group By function in Edit Query Mode
Final Result
Hope this helps.
Regards
Abduvali
- Celador8 years agoFrequent Visitor
Is there no way to write a single measure that will result in the Answer of 3 & 2?
- Abduvali8 years agoSkilled Sharer
You IF statement, create new column:
Column = if(Sheet2[Level] = "red",
CALCULATE(COUNT(Sheet2[level]),Sheet2[Level] = "Red"),
CALCULATE(COUNT(Sheet2[level]),Sheet2[Level] = "Blue")
)
- Abduvali8 years agoSkilled Sharer
Create new column with IF statement in it:
Column =
if(Sheet2[Level] = "red",
CALCULATE(COUNT(Sheet2[level]),Sheet2[Level] = "Red"),
CALCULATE(COUNT(Sheet2[level]),Sheet2[Level] = "Blue")
)
Regards
Abduvali
- Zubair_Muhammad8 years agoCommunity Champion
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" ) )