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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Nested IFs in query editor

Hi All,

 

Need your help in writing below formula from excel in custom column:

 

=IF(A2="AMS",IF(TIME(HOUR(B2),MINUTE(B2),SECOND(B2))>10:30:00 PM,DATE(YEAR(B2),MONTH(B2),DAY(B2))+1+11:30:00 AM+4:00:00,B2+4:00:00),IF(TIME(HOUR(B2),MINUTE(B2),SECOND(B2))>7:30:00 PM,DATE(YEAR(B2),MONTH(B2),DAY(B2))+1+11:30:00 AM+4:00:00,B2+4:00:00))

(Time highlighted in Orange is actual a decimal number in excel, However here I have pasted for ease)

 

RegionStart Date/TimeClosed TimeTarget Date/TimeSL
EMEA7/19/2017 13:047/19/2017 21:047/19/2017 17:04Not-Met
AMS7/19/2017 23:047/20/2017 14:047/20/2017 15:30Met
APJ7/19/2017 21:047/20/2017 18:047/20/2017 15:30Not-Met
AMS7/19/2017 13:047/19/2017 16:047/19/2017 17:04Met

 

Thanks for your help.

 

Regards

Abhijit

2 ACCEPTED SOLUTIONS
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi  @Anonymous,

 

It seems that you are looking for how to add the conditional column.

 

You could try the following way which is much easier, you don't need to write the expression.

 

Untitled.png

 

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Anonymous
Not applicable

Hi @v-piga-msft,

 

Thank you for your suppoert. I did a work around and then break the query in 2 parts and then applied conditional formatting.

 

it worked for me.

 

 

Thanks for your help.

View solution in original post

2 REPLIES 2
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi  @Anonymous,

 

It seems that you are looking for how to add the conditional column.

 

You could try the following way which is much easier, you don't need to write the expression.

 

Untitled.png

 

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @v-piga-msft,

 

Thank you for your suppoert. I did a work around and then break the query in 2 parts and then applied conditional formatting.

 

it worked for me.

 

 

Thanks for your help.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors