Forum Discussion
jereaallikko
Helper III
5 years agoHelp with if Function in DAX
Hi all, I am trying to show number of actions needed for my team. The idea is to create a DAX (or custom column if needed) to show number of items where some actions are needed. Data table il...
- 5 years ago
Hi jereaallikko ,
Try this measure:
#CountItems = COUNTAX(FILTER(T, T[Status] IN {"Pending","Open","Cancelled","Closed"} && OR(T[InfStatus] = "Waiting", T[Group] = "Sales")), T[ID])If this post helps, then please consider Accept it as the solution ✔️to help the other members find it more quickly.
jereaallikko
Helper III
5 years agoHi ERD
One more question regarding the issue.
How should I mofidy the measure if I want to add more conditions?
Just as an example:
All the previous conditions + action needed when Handler = Jake? or ID = 578344
I tried to add conditions to the measure as below, but it is giving error.
COALESCE(
COUNTAX(FILTER(T, T[Status] IN {"Pending","Open","Cancelled","Closed"} && OR(T[InfStatus] = "Waiting", T[Group] = "Sales", T[Handler] = "Jake", T[ID] = "578344")), T[ID]),
0)
Thanks in advance,
Jere
ERD
Community Champion
5 years agoYou need to use Or (||) operator in this case. https://dax.guide/op/or/