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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Replicate IF Formula in DAX

Based on screenshot below, I need the following logic to be replicated in DAX:

IF(Job_Booking_DateTime < 12 midday, IF(hour of Job_Booking_DateTime + hours in Acceptance_Elapsed_Time <24), "Y","N"),"N")

 

Job Bookings.PNG

 

Here is sample data file

 

Appreciate any help, thanks.

1 ACCEPTED SOLUTION

Hi @Anonymous ,

If this solves your problem, please mark it as a solution so that others may find it more quickly!

 

Thank you,

Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

7 REPLIES 7
Nathaniel_C
Community Champion
Community Champion

 

Hi @Anonymous , 

Try this.

 

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel

 

IF(Hour(Job_Booking_DateTime) < 12,

IF(Hour(Job_Booking_DateTime) + Hour(Acceptance_Elapsed_Time ) <24,

"Y","N"),"N")




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi @Anonymous ,

Which column would you like to use for the weekend specification.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi @Anonymous ,

Wrap this around the above formula, and fill in the date.

 

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel

 

If (WEEKDAY(Date, 2) = 6 || WEEKDAY(Date,2) = 7, “”,The formula applied above)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

@Nathaniel_C  thank you but there some blanks in Acceptance_DateTime column so how do I include IF Blank(), return " "?

Anonymous
Not applicable

@Nathaniel_C its ok I fixed it. Thank you again for you help, appreciate it.

Hi @Anonymous ,

If this solves your problem, please mark it as a solution so that others may find it more quickly!

 

Thank you,

Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

I forgot to mention to exclude weekends in the formula i.e. Saturday and Sunday

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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