Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hi All,
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:
| ID | Type | RelatedID | StartDate | EndDate |
| 1 | Primary | |||
| 2 | Sub | 1 | 01-02-2022 | 25-01-2022 |
| 3 | Sub | 1 | 15-03-2022 | 20-04-2022 |
| 4 | Primary | |||
| 5 | Sub | 4 | 10-02-2022 | 17-04-2022 |
| 6 | Sub | 4 | 31-05-2022 | 14-06-2022 |
| 7 | Sub | 4 | 05-03-2022 | 06-04-2022 |
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.
Any help would be greatly appreciated
Solved! Go to Solution.
Hey Mavie,
You could do that in a way using the implicit row context in calculated columns.
Result:
Hey Mavie,
You could do that in a way using the implicit row context in calculated columns.
Result:
Thank you, this seems to work as I intended 😊
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 3 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 19 | |
| 12 | |
| 11 | |
| 6 | |
| 6 |