Forum Discussion
Anonymous
4 years agoNot applicable
Current Month - DAX
I have a table with 3 years of Data and am writing a dax to get the Current month but somehow it's looking at the past current month as well. What's wrong? = if Date.MonthName( DateTime.Loc...
- 4 years ago
You can adapt your code like this
= if Date.MonthName( DateTime.LocalNow() ) = Date.MonthName([Date]) and Date.Year( DateTime.LocalNow() ) = Date.Year([Date]) then "Current Month" else Date.MonthName([Date])
Pat
mahoneypat
4 years agoMicrosoft Employee
You can adapt your code like this
= if Date.MonthName( DateTime.LocalNow() ) = Date.MonthName([Date]) and Date.Year( DateTime.LocalNow() ) = Date.Year([Date]) then "Current Month" else Date.MonthName([Date])
Pat
- Anonymous4 years agoNot applicable
Thanks, It Worked!