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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
alanphamvistra4
Frequent Visitor

Convert Excel Equations into Equivalent DAX Equation to Add Calculated Column to Loaded Data

I am trying to convert an equation I used in excel into a DAX equation to create a calculated column to add to data table that is already loaded into Excel.

 

Excel Equation: 

Status=IF(DATEVALUE(A5)<$D$1,"Expired",IF(DATEVALUE(A5)-30<$D$1,"Expiring","Active"))

 where A5 is Expected Expiration Date and Date is = TODAY()

 

What would be a similar DAX equation?

 

 

2 REPLIES 2
SivaMani
Resident Rockstar
Resident Rockstar

@alanphamvistra4, Create a calculated column in your table using DAX,

 

Status = SWITCH(
    TRUE(),
    'Date'[Expected Expiration Date] < TODAY(),
    "Expired",
    DATEADD('Date'[Expected Expiration Date],-30,DAY) < TODAY(),
    "Expiring",
    "Active"
)

 

Hope this helps!

Anonymous
Not applicable

Hi, Try this.

 

Column Calculated = IF(DATEVALUE([COLUMN WITH A5])<TODAY(),"EXPIRED",IF(DATEADD([COLUMN WITH A5],-30,DAY)<TODAY(),"EXPIRING","ACTIVE")

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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