The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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!