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
Danniii_
Helper I
Helper I

If statement for between to time stamps (Working hours)

Hi, 

 

I have had a look at a few other posts but none of them seem to bring back what I need. 

 

I am looking for somthing like an IF statement to tell me the following 

TIME = 15:36

Working hours = 07:00 till 17:00

 

IF 'TIME' is between 07:00 and 17:00, "In Day", "Out Of Hours"

 

Thanks 

 

 

1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

Hi @Danniii_ 

try

Column = IF(
[TIME] >= TIME(7, 0, 0) && [TIME] <= TIME(17, 0, 0),
"In Day", "Out Of Hours"
)

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

4 REPLIES 4
az38
Community Champion
Community Champion

Hi @Danniii_ 

try

Column = IF(
[TIME] >= TIME(7, 0, 0) && [TIME] <= TIME(17, 0, 0),
"In Day", "Out Of Hours"
)

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Perfect thank you, I kept trying "AND" and it wasn't working didn't think to use "&&"

az38
Community Champion
Community Champion

@Danniii_ 

so, does it work ok?


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Yes it working perfectly thanks.

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.