cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Lolu Frequent Visitor
Frequent Visitor

Trying to rewrite the following IFELSE satement in DAX

 

Hi Guys,

I am trying to reqritethis in DAX.

 

(IF [CASEPRIORITY] = 1 THEN [CRITICALRESPONSETIME]

 

ELSEIF [CASEPRIORITY] = 2 THEN [URGENTRESPONSETIME]

 

ELSEIF [CASEPRIORITY] = 3 THEN [NORMALRESPONSETIME]

END)

 

At the moemnt I am only able to write for one condition, how can I get all three in one DAX statement.

Many Thanks in Advance.

L

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Trying to rewrite the following IFELSE satement in DAX

Hey,

 

I guess you are looking for the SWITCH() function:

https://msdn.microsoft.com/en-us/library/gg492166.aspx

 

Hope this helps

Hamburg - Germany
If I answer you question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!
3 REPLIES 3
Super User
Super User

Re: Trying to rewrite the following IFELSE satement in DAX

Hey,

 

I guess you are looking for the SWITCH() function:

https://msdn.microsoft.com/en-us/library/gg492166.aspx

 

Hope this helps

Hamburg - Germany
If I answer you question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!
Lolu Frequent Visitor
Frequent Visitor

Re: Trying to rewrite the following IFELSE satement in DAX

Yes! I rewrote it as

Deadline = SWITCH([CASEPRIORITY],"1",[CRITICALRESPONSETIME],"2",[URGENTRESPONSETIME],"3",[NORMALRESPONSETIME])

and it works prectectly.

Thanks

L

v-ljerr-msft Super Contributor
Super Contributor

Re: Trying to rewrite the following IFELSE satement in DAX

Hi @TomMartens,

 

Great to hear the problem got resolved! Could you accept the helpful reply as solution to close this thread? Smiley Happy

 

Regards

Helpful resources

Announcements
Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Power BI Helps Homeless and Trouble Youth

Power BI Helps Homeless and Trouble Youth

We spoke with Power BI Super User, Greg Deckler, about his charity work

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 318 members 3,357 guests
Please welcome our newest community members: