Forum Discussion
Matching dates
- Anonymous9 years ago
Hi jadewind,
I haven't created ant relationship between the two tables. You can check the attached PBIX file to get more details about how to create the calculated column.
Thanks,
Lydia Zhang
Hi jadewind,
Do you want to get the location when Incident Date equals to the Start Date or End Date? If that is the case, I make a test using the following two tables.
In Table5, you can just create a calculated column using the formula below, then create a table visual using the calculated column and other fields.
GetLocation = CALCULATE(FIRSTNONBLANK(Table4[Locations],Table4[Locations]),FILTER(Table4,(Table4[Start Date]=Table5[Incident Date]||Table4[End Date]=Table5[Incident Date])&&Table4[ID]=Table5[ID]))
However, if you want to get the location when Incident Date is between Start Dare and End Date, just create a calculated column using the formula below, then create a table visual using the calculated column and other fields.
GetLocation1 = CALCULATE(FIRSTNONBLANK(Table4[Locations],Table4[Locations]),FILTER(Table4,Table4[Start Date]<=Table5[Incident Date]&&Table5[Incident Date]<=Table4[End Date]&&Table4[ID]=Table5[ID]))
Thanks,
Lydia Zhang
Or I think the bit after <= has to be a measure not a column?
- Anonymous9 years agoNot applicable
Hi jadewind,
I haven't created ant relationship between the two tables. You can check the attached PBIX file to get more details about how to create the calculated column.
Thanks,
Lydia Zhang