Forum Discussion
wnicholl
3 years agoResolver II
Rolling Dates
I have dax measue that works but I beleive the dates are static and would need to be manually updated for the next months. I need the dates to automatically change; From: DATE(2022,05,01), DATE(2023...
- 3 years ago
Sorry, I misread your starting date, it is in 2022 so that would look like this which makes more sense.
2023 Inforce = VAR _Start = EOMONTH ( TODAY(), -13 ) + 1 VAR _End = EOMONTH ( TODAY(), -1 ) RETURN CALCULATE ( COUNTA ( 'AISCVGP'[ACCUS#] ), AISCVGP[ACSTA] = "ACT", DATESBETWEEN ( 'Calendar'[Date], _Start, _End ) )
jdbuchanan71
3 years agoSuper User
I use the VAR just to make it easier to read in this case but you could write the measure like this as well.
2023 Inforce =
CALCULATE (
COUNTA ( 'AISCVGP'[ACCUS#] ),
AISCVGP[ACSTA] = "ACT",
DATESBETWEEN (
'Calendar'[Date],
EOMONTH ( TODAY (), -13 ) + 1,
EOMONTH ( TODAY (), -1 )
)
)