Hello
I have a scenario I find difficulty finding a proper calculation logic.
In the table below I have periods which typically start on a 19 in a month and end on the 19 or 20 the next month.
I have a continuous date column, a StartDate and EndDate for the period and also an EndOfMonth I added in PowerQuery based on the Date column.
In the example below:
How could we calculate the value between StartDate and EndOfMonth for period 3 for instance?
For the range of days between 20-03-23 and 31-03-23?
Period 3 Total is 36.600
The range should give 14100.
PeriodName | Date | StartDate | EndDate | EndOfMonth | Value |
Period2 | 01/03/2023 | 20/02/2023 | 19/03/2023 | 31/03/2023 | 1.200 |
Period2 | 02/03/2023 | 20/02/2023 | 19/03/2023 | 31/03/2023 | 1.250 |
Period2 | 03/03/2023 | 20/02/2023 | 19/03/2023 | 31/03/2023 | 1.100 |
Period2 | 04/03/2023 | 20/02/2023 | 19/03/2023 | 31/03/2023 | 1.200 |
Period2 | 05/03/2023 | 20/02/2023 | 19/03/2023 | 31/03/2023 | 1.250 |
Period2 | 06/03/2023 | 20/02/2023 | 19/03/2023 | 31/03/2023 | 1.100 |
Period2 | 07/03/2023 | 20/02/2023 | 19/03/2023 | 31/03/2023 | 1.200 |
Period2 | 08/03/2023 | 20/02/2023 | 19/03/2023 | 31/03/2023 | 1.250 |
Period2 | 09/03/2023 | 20/02/2023 | 19/03/2023 | 31/03/2023 | 1.100 |
Period2 | 10/03/2023 | 20/02/2023 | 19/03/2023 | 31/03/2023 | 1.200 |
Period2 | 11/03/2023 | 20/02/2023 | 19/03/2023 | 31/03/2023 | 1.250 |
Period2 | 12/03/2023 | 20/02/2023 | 19/03/2023 | 31/03/2023 | 1.100 |
Period2 | 13/03/2023 | 20/02/2023 | 19/03/2023 | 31/03/2023 | 1.200 |
Period2 | 14/03/2023 | 20/02/2023 | 19/03/2023 | 31/03/2023 | 1.250 |
Period2 | 15/03/2023 | 20/02/2023 | 19/03/2023 | 31/03/2023 | 1.100 |
Period2 | 16/03/2023 | 20/02/2023 | 19/03/2023 | 31/03/2023 | 1.250 |
Period2 | 17/03/2023 | 20/02/2023 | 19/03/2023 | 31/03/2023 | 1.100 |
Period2 | 18/03/2023 | 20/02/2023 | 19/03/2023 | 31/03/2023 | 1.200 |
Period2 | 19/03/2023 | 20/02/2023 | 19/03/2023 | 31/03/2023 | 1.250 |
Period3 | 20/03/2023 | 20/03/2023 | 19/04/2023 | 31/03/2023 | 1.100 |
Period3 | 21/03/2023 | 20/03/2023 | 19/04/2023 | 31/03/2023 | 1.250 |
Period3 | 22/03/2023 | 20/03/2023 | 19/04/2023 | 31/03/2023 | 1.100 |
Period3 | 23/03/2023 | 20/03/2023 | 19/04/2023 | 31/03/2023 | 1.200 |
Period3 | 24/03/2023 | 20/03/2023 | 19/04/2023 | 31/03/2023 | 1.250 |
Period3 | 25/03/2023 | 20/03/2023 | 19/04/2023 | 31/03/2023 | 1.100 |
Period3 | 26/03/2023 | 20/03/2023 | 19/04/2023 | 31/03/2023 | 1.200 |
Period3 | 27/03/2023 | 20/03/2023 | 19/04/2023 | 31/03/2023 | 1.250 |
Period3 | 28/03/2023 | 20/03/2023 | 19/04/2023 | 31/03/2023 | 1.100 |
Period3 | 29/03/2023 | 20/03/2023 | 19/04/2023 | 31/03/2023 | 1.200 |
Period3 | 30/03/2023 | 20/03/2023 | 19/04/2023 | 31/03/2023 | 1.250 |
Period3 | 31/03/2023 | 20/03/2023 | 19/04/2023 | 31/03/2023 | 1.100 |