Forum Discussion
12-pune
4 years agoFrequent Visitor
Fetch dates from Another table if it exists between them
Hi all, URGENT!!
Please help me on this issue
I have 2 tables: Story data table and Iterations tables.
Story table:
| ID | Status | Sprint | BeginDate | End Date |
| 1 | Closed | AB | 3/16/2022 22:45 | |
| 2 | Closed | CD | 3/16/2022 22:45 | |
| 3 | Closed | EF | 3/14/2022 11:34 | |
| 4 | Closed | GH | 3/15/2022 15:47 | |
| 5 | Closed | 3/15/2022 11:25 |
Iterations Table:
| beginDate | endDate |
| 3/16/2022 5:30 | 3/30/2022 5:30 |
| 3/16/2022 5:30 | 3/30/2022 5:30 |
| 3/16/2022 5:30 | 3/30/2022 5:30 |
| 3/16/2022 5:30 | 3/30/2022 5:30 |
| 3/16/2022 5:30 | 3/29/2022 5:30 |
| 3/15/2022 5:30 | 3/29/2022 5:30 |
| 3/15/2022 5:30 | 3/29/2022 5:30 |
| 3/2/2022 5:30 | 3/16/2022 5:30 |
| 3/2/2022 5:30 | 3/16/2022 5:30 |
| 3/2/2022 5:30 | 3/16/2022 5:30 |
| 3/2/2022 5:30 | 3/16/2022 5:30 |
| 3/2/2022 5:30 | 3/16/2022 5:30 |
| 3/2/2022 5:30 | 3/16/2022 5:30 |
| 3/2/2022 5:30 | 3/16/2022 5:30 |
| 3/2/2022 5:30 | 3/14/2022 5:30 |
Question: I want to fetch Begin date in STORY TABLE.
Condition: If End Date from Story table comes in between Begindate and End date of Iteration Table, fetch minimum date
I tried with below logics, but its giving me wrong output.
DAX:
IF([Sprint]=BLANK() && [Status]="Closed",
CALCULATE(MIN(Iterations[beginDate]),FILTER(Iterations,Story[EndDate]>=Iterations[beginDate] && Story[EndDate]<=Iterations[endDate])),
Example:
03/16/2022 from story table comes in between of 03/16-03/30, 03/15-03/29 and 03/02-03/16 in Iteration table.
But from above DAX - i am getting output as 03/15, but ideally it should be 03/02 - because 03/16 comes in all 3 range and minimum is 03/02
But output i am getting is 03/15.
Please help community.
Example:
03/16/2022 from story table comes in between of 03/16-03/30, 03/15-03/29 and 03/02-03/16 in Iteration table.
But from above DAX - i am getting output as 03/15, but ideally it should be 03/02 - because 03/16 comes in all 3 range and minimum is 03/02
But output i am getting is 03/15.
Please help community.
12-pune
Add the following Calculated Column in the Story TableBeginDate = VAR __EndDate = Story[End Date] RETURN MINX( FILTER( Iteration, __EndDate>= Iteration[beginDate] && __EndDate <= Iteration[endDate] ), Iteration[beginDate] )