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" ) )
Is there no way to write a single measure that will result in the Answer of 3 & 2?
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 ago
Community 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" ) ) - Zubair_Muhammad8 years ago
Community Champion
Hi Celador
Just for knowledge sharing. Another way of doing this
Blue = COUNTROWS ( FILTER ( ALL ( Table1[UserId], Table1[ResponseId], Table1[Result] ), Table1[Result] = "Blue" ) )Similar way for Red
- Celador8 years agoFrequent Visitor
Hi Zubair_Muhammad - this is what I was after, I've put it in place and it is working as expected - thank you kindly.
Abduvali - really appreciate your time & you did show me a few things, it just wasn't quite what I was after, but I do appreciate it.
- Celador8 years agoFrequent Visitor
Thanks Zubair_Muhammad - is there any significant performance cost difference between the two solutions?