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! Learn more

Reply
Anonymous
Not applicable

Subtract Number Value from Date

Hello!

 

I am working in the query editor and looking to have a custom column as specified below ...

 

Date# Days (Whole number data type)NEW CUSTOM COLUMN
1/10/202011/9/2020
1/10/202021/8/2020
1/10/202031/7/2020

 

As you can see in my example table, I would like to subtract the number of days from the # Days column from the date column to output the new custom column. I am looking for code that translates that whole number into a days format so it can be properly subtracted.

 

I would appreciate any help! Thank you in advance!

1 ACCEPTED SOLUTION
camargos88
Community Champion
Community Champion

Hi @Anonymous ,

 

Try this:

Capture.PNG

 

Did I answer your question? Mark my post as a solution!
Ricardo

 



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



View solution in original post

5 REPLIES 5
djmini
Frequent Visitor

As an alternative to the above, setting the 'data type' of the column holding the number of days to 'Duration' allows it to be used in a Custom Column, with a simple Date column + or - Duration Column formula.

This worked for me and is very simple. Thanks!

camargos88
Community Champion
Community Champion

Hi @Anonymous ,

 

Try this:

Capture.PNG

 

Did I answer your question? Mark my post as a solution!
Ricardo

 



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Anonymous
Not applicable

Amazing! Thank you very much!

Hi @Anonymous ,

 

Nice you got it done!

 

Did I answer your question? Mark my post as a solution!
Ricardo



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



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.

Top Solution Authors