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! Get ahead of the game and start preparing now! Learn more
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! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 10 | |
| 9 | |
| 7 | |
| 7 |