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 Community,
I am trying to output a value to a custom column that is based on greater than x but less than x days over due.
Formula
if Duration.Days(DateTime.LocalNow() - [Date Due])>=1 and [Date Due]<7 then "1-7" else null
Error
Expression.Error: We cannot apply operator < to types Number and DateTime.
Details:
Operator=<
Left=7
Right=20/08/2014 23:00:00
Any help would be much appreciated!
Thanks, Mark
Solved! Go to Solution.
you basically need same comparison as you do for 1, right now you compare [Date Due] which is datetime type (when converted to numeric it's 40k+) with numeric 7
if Duration.Days(DateTime.LocalNow() - [Date Due])>=1 and Duration.Days(DateTime.LocalNow()-[Date Due])<7 then "1-7" else null
you basically need same comparison as you do for 1, right now you compare [Date Due] which is datetime type (when converted to numeric it's 40k+) with numeric 7
if Duration.Days(DateTime.LocalNow() - [Date Due])>=1 and Duration.Days(DateTime.LocalNow()-[Date Due])<7 then "1-7" else null
That worked perfectly. Thank you!
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.
User | Count |
---|---|
109 | |
98 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
110 | |
91 | |
84 | |
66 |