Forum Discussion
IF statement for 3 criteria
- 5 years ago
Hey JoanCampbell ,
if you are using the DAX and want to use AND then you have to write your DAX like so:
... IF( AND( AND( condition1 , condition2 ) , condition3 ) , TRUE branch , FALSE branch ) ...using DAX this will work as well, keep in mind that || means OR and && means AND
... IF( ( condition1 && condition2 && condition3 ) , TRUE branch , FALSE branch ) ...Hopefully, this provides the missing link, and helps to tackle your challenge.
Regards,
Tom
Hi JoanCampbell ,
This is a sample of data that I understand, I don't know if it's right.
From the data on the figure, only [Qty] and [Price] of A can be multiplied.
You should copy a category column first, and then pivot table as follows.
Measure
Measure = IF(CALCULATE(DISTINCTCOUNT(Merchandising[Merchandizing Type]),ALLEXCEPT(Merchandising,Merchandising[Category]))=3,MAX('Merchandising'[Qty])*MAX('Merchandising'[Price]))
Calculated column
Column = IF(CALCULATE(DISTINCTCOUNT(Merchandising[Merchandizing Type]),ALLEXCEPT(Merchandising,Merchandising[Category]))=3,[Qty]*[Price])
If my understanding is wrong, provide some sample data and expected results?
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.