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 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 ReportingThe Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 10 | |
| 9 | |
| 7 | |
| 6 |