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

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

Reply
Anonymous
Not applicable

Return Time based on conditions

I have calculated column below that returns count of job bookings based on the job booking datetime where if booking made after 12midday AND picked up by the close of business SAME day, return Yes else No.

 

JB>12 = VAR _HOUR = HOUR(FreightForward[JOB_BOOKING_DATETIME]) RETURN
IF( _HOUR >= 12 && _HOUR <= 24, "Yes","No")

 

I need to modify measure based on the following:

if booking made after 12midday AND picked up by the close of business NEXT day, return Yes else No (i.e. booking after 12midday, picked up next day by 11.59pm Note: measure should also include bookings picked up after 12midday on the same day)

Hope that makes sense. Appreciate any help, thanks.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try a formula like

JB>12 = VAR _HOUR = HOUR(FreightForward[JOB_BOOKING_DATETIME])
var _pickup = date(year(FreightForward[JOB_BOOKING_DATETIME]), month(FreightForward[JOB_BOOKING_DATETIME]), Day(FreightForward[JOB_BOOKING_DATETIME])+1)+time(23:59:59)

RETURN
IF( _HOUR >= 12 && _HOUR <= 24 && FreightForward[JOB_PICKUP_DATETIME] <=_pickup, "Yes","No")

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

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Try a formula like

JB>12 = VAR _HOUR = HOUR(FreightForward[JOB_BOOKING_DATETIME])
var _pickup = date(year(FreightForward[JOB_BOOKING_DATETIME]), month(FreightForward[JOB_BOOKING_DATETIME]), Day(FreightForward[JOB_BOOKING_DATETIME])+1)+time(23:59:59)

RETURN
IF( _HOUR >= 12 && _HOUR <= 24 && FreightForward[JOB_PICKUP_DATETIME] <=_pickup, "Yes","No")

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
Anonymous
Not applicable

Thank you @amitchandak, much apprecaited

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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.