Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello,
I am trying to write below condition for custom column if datefirst email sent is less than 24 hrs green if its equal to more than 5 days then yellow and if its more than 5 its Red but i am getting the Error below:
if [DateFirstEmailSent] = (Date.From(DateTime.LocalNow()))then "Green"
else if [DateFirstEmailSent] <=Date.AddDays(Date.From(DateTime.LocalNow()),5) then "Yellow" else if [DateFirstEmailSent] >= Date.AddDays(Date.From(DateTime.LocalNow()),6) then "Red" else "null"
Expression.Error: We cannot apply operator < to types Date and DateTime
Solved! Go to Solution.
Hi, your [DateFirstEmailSent] shall be date not date time, then it works, if it is a datetime, then it doesnt.
Hi, your [DateFirstEmailSent] shall be date not date time, then it works, if it is a datetime, then it doesnt.
Thank you and if [DateFirstEmailSent] = (Date.From(DateTime.LocalNow()))then "Green"
else if [DateFirstEmailSent] <=Date.AddDays(Date.From(DateTime.LocalNow()),5) then "Yellow" else if [DateFirstEmailSent] >= Date.AddDays(Date.From(DateTime.LocalNow()),6) then "Red" else "null"
It is looping in till second line but not looping in to the Third REd column not sure why
It is looping to Yellow if its more that 5 days but its not looping to RED or adding RED in the column if the condition is met for more than 6 days else if [DateFirstEmailSent] >= Date.AddDays(Date.From(DateTime.LocalNow()),6) then "Red" else "null"
Thank you this worked
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 5 | |
| 5 | |
| 4 |