Forum Discussion
patri0t82
4 years agoPost Patron
VALUES function with DATEADD
Hello, can someone please help me adjust this DAX measure? Currently it's collecting all hours within the selected date range, I'd like to use DATEADD to select minus one month YTD Hours Count =...
- 4 years ago
This works!
YTD Hours Count (Last Month) =CALCULATE(TOTALYTD (SUM ( 'Hours - Tabular'[Value] ),DATEADD( 'CalendarTable'[Date], -1, MONTH)),USERELATIONSHIP ( 'Recordable'[Operating Area], 'Hours - Tabular'[Operating Area] )) + 0
patri0t82
4 years agoPost Patron
I think I figured it out:
YTD Hours Count (Last Month) =
CALCULATE (
SUM ( 'Hours - Tabular'[Value] ),
USERELATIONSHIP ( 'Recordable'[Operating Area], 'Hours - Tabular'[Operating Area] ),
VALUES(CalendarTable[Date]),
DATEADD(CalendarTable[Date],-1,MONTH)
)