Forum Discussion

pedroccamaraDBI's avatar
pedroccamaraDBI
Post Partisan
5 years ago
Solved

Total for each date, between 2 dates

Hello all

I have this table:

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

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi pedroccamaraDBI 

     

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

     

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

    or

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

     

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi pedroccamaraDBI 

     

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

     

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

    or

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