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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register 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.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors