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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
kmlcoch
Frequent Visitor

DAX Formula Help

I am trying to figure out how to subtract a number from a date. For further context, I have a "Lead-Time" column and I have a "Expiration Date" column. Lead-Time is a whole number and expiration date is a date. I need to subtract the number of days that is my lead time from the expiration date. So if the lead time is ten days and the expiration date is 9/18/22, I need the new column to populate with the date 9/8/22. Is there a way to do this using DAX?

 

Thanks in advance!

1 ACCEPTED SOLUTION
truptis
Community Champion
Community Champion

Yes @kmlcoch , you can change the interval dynamically. Try this:
Result = DATEADD([Expiration Date].[date], lead-time, DAY)

View solution in original post

4 REPLIES 4
truptis
Community Champion
Community Champion

Hi @kmlcoch ,
Try using DATEADD() 
Eg- Result = DATEADD([Expiration Date].[date], -10, DAY)

@kmlcoch -> Please hit the thumbs up & mark it as a solution if it helps you. Thanks.

Is there a way to put the column in the second array instead of the number? otherwise it would all be manual

 

truptis
Community Champion
Community Champion

Yes @kmlcoch , you can change the interval dynamically. Try this:
Result = DATEADD([Expiration Date].[date], lead-time, DAY)

That worked! Thank you so much

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.