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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Luiwujamak
Frequent Visitor

Nested If problem with hours columns

Hello everyone, i'm having a little trouble with this If statement, where i'm trying to check by the "EndHour" if its "Morning" or "Evening" shift. Everything works perfectly from this point:

 

= Table.AddColumn(#"Renamed Columns1", "Shift", each if [Hora_Salida] <= Time.FromText ("4:30:00 PM") then "Matutino" else "Vespertino" )

 

But i found that theres some records where the "EndHour" is "Null"  but i do not know how to use the nested if to check that if the "EndHour" is Null then to compare with the "StartHour" 

 

Will appreciate if anyone can help me with it

 

Luiwujamak_0-1674588044454.png

 

1 REPLY 1
amitchandak
Super User
Super User

@Luiwujamak , Based on what I got, change as per need

 

Table.AddColumn(#"Renamed Columns1", "Shift", each if [Hora_Salida] <> null and [Hora_Salida] <= Time.FromText ("4:30:00 PM") then "Matutino" else "Vespertino" )

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.