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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
lennox25
Helper V
Helper V

Help with Calculated Column which is not working as it should

Hi, 

 

Can someone help please?

 

This calculated column is not working as it should for some reason its not picking up all the required times as it should. Where I have highlighed in yellow it should be picking up those times too

Out of Hours Emails Recd =
  VAR __DateTime = [Date & Time]
  VAR __Hour = HOUR('Mailbox'[Time])
  VAR __Result = IF__Hour >= 6 && __Hour <8 || __Hour >= 16 && __Hour <18|| __Hour >= 18 && __Hour <6|| WEEKDAY(__DateTime,2) > 5,1,0)
RETURN
  __Result
 
lennox25_0-1706264772427.png

 

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

3 REPLIES 3
Ahmedx
Super User
Super User

Screenshot_1.png

Ahmedx
Super User
Super User

pls try this

Out of Hours Emails Recd =
  VAR __DateTime = [Date & Time]
  VAR __Hour = HOUR('Mailbox'[Time])
  VAR __Result = 
IF( 
__Hour >= 0 && __Hour <8 || 
__Hour >= 16 && __Hour <18|| 
__Hour >= 18 && __Hour <24||
WEEKDAY(__DateTime,2) > 5,
1,0)
RETURN
  __Result

Thank you for answering and providing a solution so quickly 🙂

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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