Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
I have a field that contains expiry date for items, and another date that contains warning before expiry. This is important to make the stock controller who which product is about to expiry.
I need to construct a good Dateadd calculation that will give three status against today, Expired, Closed to Expiry and Ok
this is what we have done in SQL but reconstructing in Powerbi is proving a challenge.
case
when dateadd(day,1, constants.today) >= PartLot.ExpirationDate then '*** EXPIRED!!!***'
when dateadd(day,PartClass.Alert1_c, constants.today) > PartLot.ExpirationDate then '*** CLOSED TO EXPIRY !!!***'
when dateadd(day,PartClass.Alert1_c + 400, constants.today) > PartLot.ExpirationDate then '*** OK!!!***'
else '*** CHECK EXPIRY DATE !!!***'
end
@Anonymous Please try something like this...
IF(
DATEADD(constants.today,1,DAY) >= PartLot.ExpirationDate,"*** EXPIRED!!!***",
IF(DATEADD(constants.today,PartClass.Alert1_c,DAY) > PartLot.ExpirationDate,"*** CLOSED TO EXPIRY !!!",
IF(DATEADD(constants.today,PartClass.Alert1_c+400,DAY) > PartLot.ExpirationDate, "*** OK!!!***")
)
)
Proud to be a PBI Community Champion
this looks more like a sql function, formatting it to a DAX returns errors
Hi
I just wanted to check, you want to do this in a custom column, rather than a measure right?
Thanks
yes pls
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.