Forum Discussion
Anonymous
4 years agoNot applicable
Excel function to DAX
Hi, I need some help converting an excel formula into DAX. Excel: =DATE(YEAR(TODAY()),MONTH(TODAY())-[@[- Months]]+1,0) - Months = is a selection with the month number values (1 thru 12) Result ...
Jihwan_Kim
Super User
4 years agoHi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
It is for creating a new column.
Result CC =
VAR _todaymonth =
MONTH ( TODAY () )
VAR _todayyear =
YEAR ( TODAY () )
VAR _condition = _todaymonth > 'Months Table'[@Months]
RETURN
IF (
_condition = TRUE (),
(
_todayyear & "-"
& FORMAT ( _todaymonth - 'Months Table'[@Months], "00" )
)
)