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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
mdrammeh
Helper III
Helper III

How to Counting Date values Backwards

I have a date column titled "Scheduled Start Date" for millions of columns in Power Query. I want to calculate the number of days prior to the "Schedule Start Date".

I tried to formulas for the result always returns an error message:

Date.AddDays([Scheduled Start],-27,MONTH)) 

Could someone help me here at your convenience 🙂

 

2 REPLIES 2
v-qiuyu-msft
Community Support
Community Support

Hi @mdrammeh,

 

The syntax of the Date.AddDays() function is Date.AddDays(dateTime, days as number), so you need to modify the expression like this Date.AddDays([Scheduled Start],-27).

 

As you mentioned you want to calculate the number of days prior to the "Schedule Start Date", I guess the Duration.TotalDays should be more proper, see: DATEDIFF in Power Query.

 

Best Regards,

Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
MarcelBeug
Community Champion
Community Champion

Probably you mean rows instead of columns.

 

Anyhow: remove ",MONTH)"  from the formula (or use Date.AddMonths).

Specializing in Power Query Formula Language (M)

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors