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.
I have two columns in my date which is approval date and expiry date, and I need to apply this condition using M query:
If Approval date <= Current Date and Expiry Date >=Current Date then "Active" else "Expired"
I've tried this query in the Power BI desktop and is running but when I run it in the Power BI Data flows it gives me an error:
Solved! Go to Solution.
Try wrapping Date.TimeLocalNow() with DateTime.Date(), so DateTime.Date(DateTime.LocaNow())
DateTime.LocalNow will returns the date and time, and you may get comparison errors if you are comparing strictly to a date. DateTime.Date will strip out the time component.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingTry wrapping Date.TimeLocalNow() with DateTime.Date(), so DateTime.Date(DateTime.LocaNow())
DateTime.LocalNow will returns the date and time, and you may get comparison errors if you are comparing strictly to a date. DateTime.Date will strip out the time component.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingCovering 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.