Forum Discussion
DAX COUNT based on multiple criteria in same table
Hi,
In the same table ("Table Z") i have 2 columns: Column A and Column B.
Column A Column B
done 7261
on work 13
developed 302
done 290
on work 913
approved 6100
developed 120
on work 2000
I need to COUNT the values of Column B only when Column A is = "done" OR when Column A = "on work"
Could someone please help me
- Anonymous3 years agoTest = Calculate(COUNT(TestTable[B]), TestTable[A] = "done" || TestTable[A] = "on work")Here you go pal, tested it so it should work 🙂 accept as solution if it works for you! 🙂
8 Replies
- AnonymousNot applicable
Do you mean you need to sum the values instead of count? 🙂
- geroagostini
Helper I
No! sorry for the confusion. I need to COUNT how many values there are with the criteria of Column A is = "done" OR when Column A = "on work".
- AnonymousNot applicable
No Problem! so If we had a working measure, what would you be expecting it to return? 🙂
- AnonymousNot applicable
For the data you provided, there are 5 columns in A where A = done or on work.
Would you expect your measure to return 5?- geroagostini
Helper I
Exactly!
- AnonymousNot applicableTest = Calculate(COUNT(TestTable[B]), TestTable[A] = "done" || TestTable[A] = "on work")Here you go pal, tested it so it should work 🙂 accept as solution if it works for you! 🙂