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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
android1
Post Patron
Post Patron

Using IF to calculate that an appointment is on time

Hi,

 

I am trying to use an IF statement to calculate if someone was on time for an appointment. 15 mins either side of appointment 

time is considered as on time, anything else is late. 

If appointment is at 17:00 then anything between 16:45 - 17:15 is ontime.

 

Trying this -> Late = IF(OTIF[TimeFrom] > OTIF[DutyTimeFrom] * 1.25,"Late",IF(OTIF[TimeFrom] < OTIF[DutyTimeFrom] * .75,"Late","OnTime") ). Not getting any errors but results are incorrect.

 

I am using this statement  when adding a new column in Report view.

1 ACCEPTED SOLUTION
sornavoor
Resolver I
Resolver I

 

Try this... 

Late = IF (OTIF[DutyTimeFrom]<OTIF[TimeFrom]-1/24*.25,"Early",IF (OTIF[DutyTimeFrom]>OTIF[TimeFrom]+1/24*.25,"Late","On Time"))

 snip_20160506132945.png

View solution in original post

2 REPLIES 2
sornavoor
Resolver I
Resolver I

 

Try this... 

Late = IF (OTIF[DutyTimeFrom]<OTIF[TimeFrom]-1/24*.25,"Early",IF (OTIF[DutyTimeFrom]>OTIF[TimeFrom]+1/24*.25,"Late","On Time"))

 snip_20160506132945.png

Works perfectly. Thank you very much.

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.

July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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