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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
pedroccamaraDBI
Post Partisan
Post Partisan

Total for each date, between 2 dates

Hello all

I have this table:

test.JPG

This is a table to reminde me that i have to pay for each contract, on that day, for all the months between In Date and End Date.
I believe i have to figure out how many months do i have between those 2 dates, add the day and year to that number, and the value to it.
The only problem is that i don't know how to do it and it has to be in power query.
Anyone can help me?
Thanks a lot guys
Pedro

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @pedroccamaraDBI 

 

I am a little bit confused, you want the Months or the days?

 

Vera_33_0-1625104245911.png

(Date.Year([End Date])-Date.Year([In Date]))*12
+
Date.Month([End Date])-Date.Month([In Date])

or

Vera_33_1-1625104320707.png

Duration.TotalDays([End Date]-[In Date])

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @pedroccamaraDBI 

 

I am a little bit confused, you want the Months or the days?

 

Vera_33_0-1625104245911.png

(Date.Year([End Date])-Date.Year([In Date]))*12
+
Date.Month([End Date])-Date.Month([In Date])

or

Vera_33_1-1625104320707.png

Duration.TotalDays([End Date]-[In Date])

 

Very good. Thanks a lot!

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors