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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
LABrowne
Helper II
Helper II

DATEADD error - How to subtract days from date

Hi there,

 

I am working with a SQL server based power bi report.

 

Trying to subtract 90 days from a date this is what I have currently:

 

DATEADD(Order[ExpiryDate],-90,DAY)
 
Unfortunately the error message I get is that this formula doesn;t support duplicates.
 
Is there any work around this?
 
Thanks in advance for any help!
1 ACCEPTED SOLUTION

The () in your formula need to change to EDATE(MAX(Order[ExpiryDate]),-3)

 

I believe that EDATE for your request is much better if you are looking for finding a date in 3 month before the current because some months have 31 or 28 days and 90 days is not the exact calc.

 

View solution in original post

3 REPLIES 3
VahidDM
Super User
Super User

Hey
It seems there are duplicate values in your column ( same date in multiple rows ).And you are using time intelligence functions.
Use this:
Order[ExpiryDate] - 90

 

Or make sure to add a Date Table and connect it to your table and use that instead.

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos!! 

Badges.jpg

LinkedIn | Twitter | Blog | YouTube 

Hi VahidDM,

 

Thanks for your help.

 

I use EDATE(MAX(Order[ExpiryDate],-3)) and that seems to work but I'm not sure if that will work with every order.

The () in your formula need to change to EDATE(MAX(Order[ExpiryDate]),-3)

 

I believe that EDATE for your request is much better if you are looking for finding a date in 3 month before the current because some months have 31 or 28 days and 90 days is not the exact calc.

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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