Rolling12UpTime = CALCULATE( sum('Date'[UptimeMin]), (DATESINPERIOD('Date'[Date], LASTDATE('Date'[Date]), -1, YEAR)) )
Date[UptimeMin] is a simple calculated column:
UptimeMin = calculate(24*60)
The Date table only has dates from 2015 through the current date, as I am using this to show YTD and rolling 12 up through "today". All of the YTD measures work correctly (using TOTALYTD), but the measure Rolling12UpTime above (using the DAX pattern for "moving annual totals") seems to be doing some subtracting on the last date:
The amount that is missing is curiously exactly 18*1440, which is exactly the number of minutes in remainder of the month after today (1/13/17).
What could be happening here? I just wrote the measure today in the January 2017 update of PowerBI Desktop, in case anyone can produce the correct calculation on an earlier version of desktop. The Date table could consist of just Date and UptimeMin.
Thanks,
David Edelman
EDITED TO ADD: I bumped up the Date table to have all values through tomorrow (1/14/17). This fixed the value for 1/13 but the value for 1/14 is now incorrect by 17*1440.