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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

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

@Anonymous , 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" )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors