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 ...
amitchandak
4 years agoSuper User
Anonymous , You can create a measure
format(DATE(YEAR(TODAY()),MONTH(TODAY())-selectedvalues(month[month])+1,1), "YYYYMM")
or
format(DATE(YEAR(TODAY()),MONTH(TODAY())-selectedvalues(month[month])+1,1), "YYYYDD")
or
format(DATE(YEAR(TODAY()),MONTH(TODAY())-selectedvalues(month[month])+1,day(Today()) ), "YYYYMM")
or
format(DATE(YEAR(TODAY()),MONTH(TODAY())-selectedvalues(month[month])+1,day(Today()) ), "YYYYDD")
- Anonymous4 years agoNot applicable
Thank you for your reply. I am going to give this a try.
Should I create measure columns for all excel functions in Power BI?
Thank you again.