I’m calculating the last 30 days vs the previous 30 days.
These are my measures:
Total Current 30 Days =
CALCULATE(
[Switch Currency],
FILTER(
'Calendar',
'Calendar'[Date] >= TODAY() - 31 &&
'Calendar'[Date] <= TODAY() - 2
)
)
and
Total Previous 30 Days =
CALCULATE(
'Costs Summary Table'[Sum of measures],
FILTER(
'Calendar',
'Calendar'[Date] >= TODAY() - 61 && -- Go back 61 days to cover a full 30-day period before the previous 30 days
'Calendar'[Date] <= TODAY() - 32 -- Go back 32 days to end 31 days ago
)
)
If I put the two on the Area Chart I see this:
- Total Previous 30 Days: goes from the 25 of April till the 24 of May (29 days)
- Total Current 30 Days: goes from the 25 of May till the 23 of June (29 days)
And if I check on timeanddate.com they are really 29 days:
But if I overlap them one results in 30 days, the other in 31 days. (note I have removed the Month from the x-axis):
Where the hell an I wrong?