cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pedroccamaraDBI
Helper IV
Helper IV

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
Vera_33
Super User
Super User

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
Vera_33
Super User
Super User

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

Very good. Thanks a lot!

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors