Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

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...
  • mahoneypat's avatar
    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