Forum Discussion
Dax for multiple (and,or) statement
Sales value < 90 and either
3+ sales rating AND 4+ salesman OR
5+ sales rating AND 1+ salesman
Actually I wanted to add a filter in power bi but the filter won't satisfy all the condition at once. Please help me with dax for these. Thank you
Sales value < 90 and either 3+ sales rating AND 4+ salesman OR 5+ sales rating AND 1+ salesman If(Sales value <90 && sales rating >=3 && salesman >=4 || Sales value <90 && sales rating >=5 && salesman >=1,1,0)Hi NISH72 ,
If I understand what you are looking for you can use && and || .
https://docs.microsoft.com/en-us/dax/dax-operator-reference
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos πare nice too.
NathanielYou could do it with a FILTER like:
VAR __table = FILTER( Sales value < 90 && ( Sales rating >= 3 && Salesman >= 4 || Sales rating >= 5 && Salesman >= 1 ) )
5 Replies
- Nathaniel_CCommunity Champion
Sales value < 90 and either 3+ sales rating AND 4+ salesman OR 5+ sales rating AND 1+ salesman If(Sales value <90 && sales rating >=3 && salesman >=4 || Sales value <90 && sales rating >=5 && salesman >=1,1,0)Hi NISH72 ,
If I understand what you are looking for you can use && and || .
https://docs.microsoft.com/en-us/dax/dax-operator-reference
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos πare nice too.
Nathaniel- NISH72Helper IVThank you for your reply. After I use this dax the sales rating and salesman fields are still showing below 3 values even though sales values is showing correct i.e below 90
- Nathaniel_CCommunity Champion
Hi NISH72 ,
Please read this post to get your question answered more quickly:
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Please provide us with a pbix, or a table to show us what you are doing.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos πare nice too.
Nathaniel
- Greg_DecklerCommunity Champion
You could do it with a FILTER like:
VAR __table = FILTER( Sales value < 90 && ( Sales rating >= 3 && Salesman >= 4 || Sales rating >= 5 && Salesman >= 1 ) )- NISH72Helper IVThank you for your reply. When I use this dax I get the following error- 'expression refers to multiple column. Multiple column cannot be converted to scalar values.