cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
sudanaditya Frequent Visitor
Frequent Visitor

Formula to validate two date ranges

Hello All - I have a requirement where we need to write a validation either in DAX or in Power Query for the below scenario.

Clone start date  9/1/2019

Clone End date  9/5/2019

CRP start date - 9/5/2019

CRP End date -10/1/2019

 

The scenario   is that the conditional colum should populate"Risk" else "no Risk"  if any one of the dates in the  CRP start date and CRP end Date ( Range) fall in betweeen Clone Start - Clone end date ( Range) .

Thanks in advance .

Sudan

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

Re: Formula to validate two date ranges

Putting the folling in a calculated column should give you want you want. This logic should cover both full and partial overlaps.

 

= IF (  [CRP start date] <= [Clone end date] 
  && [CRP end date] >= [Clone start date], "Risk", "No Risk")

View solution in original post

1 REPLY 1
Super User III
Super User III

Re: Formula to validate two date ranges

Putting the folling in a calculated column should give you want you want. This logic should cover both full and partial overlaps.

 

= IF (  [CRP start date] <= [Clone end date] 
  && [CRP end date] >= [Clone start date], "Risk", "No Risk")

View solution in original post

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

January 2020 Community Highlights

January 2020 Community Highlights

Make sure you didn't miss any of the things that happened in the community in January!