cancel
Showing results for
Did you mean:
Highlighted
Post Prodigy

How to work with multiple conditions in dax

Hello,

does someone know how to select a value based on 3 or 4 conditions at the same time.

ex:

var1 = if(
condition1 and condition2 and condition3 the do something

if condition4 and condition 5 and condition6 then do something1

else something3)

ex: End Date=
if (isblank('var1')) && revenue > 100000 and revenue <= 500000 , value1,
if (blank(var1) && revenue >500000 , value2
else value3)

The second line (value2) work and the last line (value3) but the first value is never attribuated.

Regards,

Alain LePage

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User VI

Re: How to work with multiple conditions in dax

Hi @alepage

I have no idea what exactly do you nedd but it may look like

``````End Date=
if (isblank([var1]) && [revenue] > 100000 && [revenue] <= 500000 , [value1],
if( isblank([var1]) && [revenue] >500000, [value2], [value3]) )``````

do not hesitate to give a kudo to useful posts and mark solutions as solution

3 REPLIES 3
Highlighted
Super User VI

Re: How to work with multiple conditions in dax

Hi @alepage

I have no idea what exactly do you nedd but it may look like

``````End Date=
if (isblank([var1]) && [revenue] > 100000 && [revenue] <= 500000 , [value1],
if( isblank([var1]) && [revenue] >500000, [value2], [value3]) )``````

do not hesitate to give a kudo to useful posts and mark solutions as solution

Highlighted
Community Support

Re: How to work with multiple conditions in dax

Hi @alepage ,

I found that the condition1 is the same as condition4 in your example. Is it right?

And the value3 is in the second IF(), do you mean to get it in the first IF()?

``````End Date=
SWITCH (
TRUE (),
ISBLANK ( [var1] )
&& [revenue] > 100000
&& [revenue] <= 500000, [value1],
ISBLANK ( [var1] )
&& [revenue] > 500000, [value2],
[value2], [value3]
)
``````

If this post helps, then please consider Accept it as the solution to help the other members find it.
Highlighted
Post Prodigy

Re: How to work with multiple conditions in dax

The first condition is revenue greater than 10000 and less or equal to 50000 while the third condition is greater than 50000

Announcements

Meet the 2020 Season 2 Power BI Super Users!

Find out who's part of the program this season, and welcome the new Super Users.

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

July 2020 Community Highlights

Learn about the exciting things that happened in July.

Featured Data Story of The Month

All Data Stories Gallery contributions are reviewed for each month. We select a contribution and feature the community member the following month.

Power BI Dev Camp - Developing with .NET Core

Learn how to develop custom web applications for Power BI using .NET Core 3.1 and .NET 5.

Top Solution Authors
Top Kudoed Authors