Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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
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
)