Forum Discussion
lcap
3 years agoNew Member
DAX 'Current Month'
Hiya, I'm struggling to work out how to formulate a column with an IF statement - i'm stuck how to express Current Month. Thanks in advance.
- 3 years ago
Try:
Before current month = VAR _YMToday = YEAR ( TODAY () ) * 100 + MONTH ( TODAY () ) VAR _YMField = YEAR ( MAX ( 'Dates Table'[Date] ) ) * 100 + MONTH ( MAX ( 'Dates Table'[Date] ) ) RETURN IF ( _YMField = _YMToday, "Current month" )
PaulDBrown
3 years agoCommunity Champion
for current month use
MONTH(TODAY()) && YEAR(TODAY())
So if have a date table, the expression would be
... 'Date Table'[Month] = MONTH(TODAY()) && 'Date Table'[Year] = YEAR(TODAY())