Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
g-wizard
Frequent Visitor

If/ElseIf Statements from Tableau

Hello, I am still very new to PBI.

Just had a question on how I should translate this to Dax?

 

IF [# of Days Remaining]<0
THEN "Past Expiration Date"
elseif [# of Days Remaining]>=0 and [# of Days Remaining]<=30
THEN "1 Month"
elseif [# of Days Remaining]>30 and [# of Days Remaining]<=60
THEN "2 Month"
elseif [# of Days Remaining]>60 and [# of Days Remaining]<=90
THEN "3 Month"
elseif [# of Days Remaining]>90 and [# of Days Remaining]<=180
THEN "6 Month"
elseif [# of Days Remaining]>180 and [# of Days Remaining]<=270
THEN "9 Month"
elseif [# of Days Remaining]>270
THEN "9+ Month "

EN

1 REPLY 1
vicky_
Super User
Super User

I would suggest using the SWITCH() function; something like the following:

SWITCH(TRUE(), 
  [# of Days Remaining]<0, "Past Expiration Date",
  [# of Days Remaining]>=0 && [# of Days Remaining]<=30,"1 Month",
  // ... etc
) 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors