Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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/2020 | 1 | 1/9/2020 |
| 1/10/2020 | 2 | 1/8/2020 |
| 1/10/2020 | 3 | 1/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!
Solved! Go to Solution.
Hi @Anonymous ,
Try this:
Did I answer your question? Mark my post as a solution!
Ricardo
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!
Amazing! Thank you very much!
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!