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!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
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!
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 16 | |
| 14 | |
| 9 | |
| 8 | |
| 7 |