Get earliest and latest date based off related IDs in the same table
I need to create measures to get the earliest and latest dates based off of a varying number of related rows.
My data look like the following:
There is a Primary type and a Sub-type, where only the Sub-type has a defined date range.
I then need to create a date range for the Primary type, based off the earliest StartDate and latest EndDate from the Sub-type with RelatedID. It is also possible for a Primary type to have no Sub-type, therefore it is possible that no date range can be created for some Primary types.
I have tried various methods but have run out of idea for how to solve this. It is also possible that two calculated columns would be a better solution.