Forum Discussion
Help with DATESINPERIOD
Not sure where I'm going wrong with this calculation, trying to calculate 12 month rolling figure total KwH
Any help much appreciated
2 Replies
- AhmedxSuper User
pls try this
CALCULATE(SUM('All sites data'[KwH]),DATESINPRIOD('Calendar'[Date], MAX(Calendar'[Date]), -12,MOUTH ))
- LizzielemanFrequent Visitor
this didn't initially work but I changed the calendar date to the date from the same table that the kwh data was in.
I was trying to use a date table for the date.
Is there a way of calculating the difference between the most recent 12 month period and the same 12 months in the previous year?
So I would want to see kwh consumption for the most recent 12 month period (currently Jan 23 to Dec 23) then would like to compare to kwh consumption during jan 22 to dec 22?
I know I could calculate a 24 month period and deduct the current 12 month figure. just wondering if theres a more streamlined way of doing this?
Thank you for your help