Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello Everyone,
I am new to this so I require some help.
Because I add my data on the first days of next month I want to create a column Query that will mark all dates that are smaller than the first day of the current month to be marked as past and all the dates in the current month and onward to be marked as future
So this is what I tried which is wrong as I received an error in my column
=if [date] < Date.StartOfMonth(DateTime.LocalNow()) then "Past" else "Future"
So for example now we have February, I want in the new column all dates before the 01/02/2024 to be marked as past
Thanks for your time
Solved! Go to Solution.
The issue is with DateTime.LocalNow(), because it is as datetime - just add Date.From before it.
if Date.From([date]) < Date.StartOfMonth(Date.From(DateTime.LocalNow())) then "Past" else "Future"
The issue is with DateTime.LocalNow(), because it is as datetime - just add Date.From before it.
if Date.From([date]) < Date.StartOfMonth(Date.From(DateTime.LocalNow())) then "Past" else "Future"
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.