Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
MartynHead
New Member

Custom Column to Category Triaging, Triaged or Late Returning an Error

My custom column is returning error based off a conditional column

Conditional Column

MartynHead_1-1685703317222.png

MartynHead_2-1685703354209.png

Code:

if [Triaging] = "Triaging" and [Triage Target] >= DateTimeZone.LocalNow() then "Triaging" else if [Triaging] = "Triaged" then "Triaged" else "Late"

This returns error for those in the triaging state

MartynHead_4-1685703392000.png

Triage Target is a custom column which is Start Date & Time & (04/24)

MartynHead_6-1685703502100.png

Any advise other than a replace Errors with Triaging?

1 ACCEPTED SOLUTION

Hi @ovde I have transformed the date format to match the left and it is fixed.

 

Thanks for your help.

View solution in original post

3 REPLIES 3
MartynHead
New Member

hi @ovde 

 

I have changed it DateTime.LocalNow() and I get this error

 

Expression.Error: We cannot apply operator < to types DateTime and Text.
Details:
Operator=<
Left=05/06/2023 11:15:50
Right=2023-06-02T14:40:00Z

Hi @ovde I have transformed the date format to match the left and it is fixed.

 

Thanks for your help.

ovde
Resolver I
Resolver I

Hi @MartynHead ,

 

Can you click on the error and tell us what is says? I suspect something is nog quite right with the DateTimeZone.LocalNow() function since your custom column is of the datetime type and not datetimezone. I suggest you use DateTime.LocalNow - PowerQuery M | Microsoft Learn

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.