Forum Discussion
Niels_T
4 years agoPost Patron
Dynamic month only for current year
I have the following DAX:
Dynamic Month = MONTH(EOMONTH(TODAY(),0))-MONTH(EOMONTH(MAX('Calendar'[Date])
I would like to have my dynamic month only applied to the current year so that in 2023 (in this case April) the value will be blank:
What I've tried so far
Dynamic Month = IF(YEAR(TODAY()), MONTH(EOMONTH(TODAY(),0))-MONTH(EOMONTH(MAX('Calendar'[Date]),blank()))).
However this gives me the same result.
Niels_T
Your condiion IF(YEAR(TODAY()) always return true 🙂
You need something like:
IF(YEAR(TODAY())= YEAR(MAX(Calendar'[Date]), ...
2 Replies
- Jihwan_KimSuper User
Hi,
I am not sure if I understood your question correctly, but please try the below measure.
Dynamic Month = ( MONTH ( EOMONTH ( TODAY (), 0 ) ) - MONTH ( EOMONTH ( MAX ( 'Calendar'[Date] ), 0 ) ) ) * DIVIDE ( VAR _condition = MAX ( YEAR ( Calendar[Date] ) ) = YEAR ( TODAY () ) RETURN _condition, _condition )