Hi, would appreaciate any help with this code, it works until I pick December, if I take a day off of December it also works so ( MAX('Calendar'[End of Month]) -1 ) i.e. 30/12/2021 will work but
I'm really not sure what it doesn't like about 31/12/2021 00:00:00 ? Thanks Gav
USERS =
VAR UDate = MAX('Calendar'[End of Month]) -- Last day of the Month
VAR UCount = CALCULATE(DISTINCTCOUNT(Sessions[USERS]),
DATESINPERIOD('Calendar'[Date],UDate,-1,YEAR))
RETURN
UCount
I'm really not sure what it doesn't like about 31/12/2021 00:00:00 ? Thanks Gav
USERS =
VAR UDate = MAX('Calendar'[End of Month]) -- Last day of the Month
VAR UCount = CALCULATE(DISTINCTCOUNT(Sessions[USERS]),
DATESINPERIOD('Calendar'[Date],UDate,-1,YEAR))
RETURN
UCount