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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Nested If with Multiple And conditions

HI,

 

So im trying to get a Calculated column which returns  Overdue or Not overdue based on certain criteria

First time poster so please forgive any errors in required  format 

 

Below is what i came up with

Overdue_VW =
IF(And([Status]="Completed",[CompleteBy]<[CompletedDate]),"Overdue",
if(and([Status]<>"Completed",And([CompletedDate]="",And([CompleteBy]<=DATE(YEAR(TODAY()),MONTH(TODAY()),1),And([Status]<>"Deleted")))),"Overdue","Not Overdue"))

 

I also tried  ( although im not familiar with the switch expression, first time ive tried to use it)

 

Overdue_VW =
IF(And([Status]="Completed",[CompleteBy]<[CompletedDate]),"Overdue",
Switch(
[Status]<>"Completed",
[CompletedDate]="",
[CompleteBy]<=DATE(YEAR(TODAY()),MONTH(TODAY()),1),
[Status]<>"Deleted"),
"Overdue", "Not Overdue"))
 
I think im close, but cant quite work out why either option isnt working,  Any help on this would be greatly appreciated
1 ACCEPTED SOLUTION

@Anonymous change you expression like this, i just copied your expression assuming tht is the business logic you want.

 

Overdue_VW = 
IF([Status]="Completed" && [CompleteBy]<[CompletedDate],"Overdue",
IF(
[Status]<>"Completed" &&
[CompletedDate]=BLANK() &&
[CompleteBy]<=DATE(YEAR(TODAY()),MONTH(TODAY()),1) &&
[Status]<>"Deleted",
"Overdue", "Not Overdue"))

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

6 REPLIES 6
ryan_mayu
Super User
Super User

@Anonymous 

when you have serveral conditions of AND logic, please use && instead of AND

e.g and(condition1,and(condition2,condition3))

you can try condition1 && condition2 && condition3

That will be easier.





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

Proud to be a Super User!




@Anonymous change you expression like this, i just copied your expression assuming tht is the business logic you want.

 

Overdue_VW = 
IF([Status]="Completed" && [CompleteBy]<[CompletedDate],"Overdue",
IF(
[Status]<>"Completed" &&
[CompletedDate]=BLANK() &&
[CompleteBy]<=DATE(YEAR(TODAY()),MONTH(TODAY()),1) &&
[Status]<>"Deleted",
"Overdue", "Not Overdue"))

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Thank you, this drove me nuts all day

 

i can see i was mixing an AND  with &&  which was over complicating things

 

really appreciate your time and the time of everyone who answered 

Fowmy
Super User
Super User

@Anonymous 

Could you explain in words what how do you need to calculate the OverDue and NonOverDue? 

If you are satisfied with my answer, please mark it as a solution so others can easily find it.

Don't forget to give KUDOS ? to replies that help answer your questions


Subscribe to ExcelFort: Learn Power BI, Power Query and Excel

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

@Anonymous post a sample data and business logic to calculate this new column.

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Hi

 

Sorry took me a while to work out how to get a sample set of data on here, Not totally sure this will work either 

 

Test PBI file 

 

 

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors