Forum Discussion
Anonymous
6 years agoNot applicable
Find Overlapping Dates Records
Hello All,
I am newbie to powerbi and i need your guide and suggestions.
I have a sample data as below.
| Task | Resource | Start | End |
| Task 1 | Resource 1 | 02-Jul-19 | 26-Aug-19 |
| Task 1 | Resource 1 | 01-Aug-19 | 26-Aug-19 |
| Task 3 | Resource 2 | 27-Aug-19 | 31-Aug-19 |
| Task 4 | Resource 3 | 01-Sep-19 | 25-Sep-19 |
| Task 5 | Resource 3 | 26-Sep-19 | 25-Oct-19 |
| Task 1 | Resource 2 | 01-Aug-19 | 26-Aug-19 |
| Task 1 | Resource 2 | 20-Aug-19 | 31-Aug-19 |
| Task 1 | Resource 3 | 01-Sep-19 | 25-Sep-19 |
| Task 1 | Resource 3 | 15-Sep-19 | 25-Oct-19 |
Now i am trying to create a column or measure which gives the count as 1
IF Start Date and End Date as getting overlapped even one day with Same Task and resource then the Column or Measure (OverLapped) gives the Count as 1.
The output that i am expecting.
I tried the below dax but it was not the expected output.
Please help.
Thanks,
Mohan V.
Hi Anonymous ,
Try this code:
Overlapping =VAR _start = 'Table'[Start]VAR _end = 'Table'[ End ]VAR _result = COUNTROWS(FILTER('Table','Table'[Task ] = EARLIER('Table'[Task ]) &&'Table'[Resource ] = EARLIER('Table'[Resource ]) &&((_start >= 'Table'[Start] && _start <= 'Table'[ End ]))))RETURN _result - 1
2 Replies
- camargos88Community Champion
Hi Anonymous ,
Try this code:
Overlapping =VAR _start = 'Table'[Start]VAR _end = 'Table'[ End ]VAR _result = COUNTROWS(FILTER('Table','Table'[Task ] = EARLIER('Table'[Task ]) &&'Table'[Resource ] = EARLIER('Table'[Resource ]) &&((_start >= 'Table'[Start] && _start <= 'Table'[ End ]))))RETURN _result - 1 - amitchandakSuper User
Anonymous , refer if this file on a similar issue can help
https://www.dropbox.com/s/1mlq21o1xjuw8il/overlappingdates.pbix?dl=0