Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
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.LocalNow() ) = Date.MonthName([Date]) then "Current Month" else Date.MonthName([Date])
How can I exclude past year/past month
Solved! Go to Solution.
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
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
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
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Thanks, It Worked!