Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi all,
I have a table with train tickets like this:
ticketId | departureName | departureDistance | arrivalName | arrivalDistance |
556822 | Paris | 0 | Rome | 1400 |
558874 | Paris | 0 | Lion | 700 |
855462 | Lion | 500 | Milan | 900 |
547798 | Milan | 900 | Rome | 1400 |
900015 | Lion | 500 | Milan | 900 |
125569 | Paris | 0 | Milan | 900 |
The route is one directional (for simplicity) and the station distances are related to route's start (here Paris).
I need to compute a table that shows how many passenger are on each segment:
segmentStart | segmentEnd | passengers |
Paris | Lion | 3 |
Lion | Milan | 4 |
Milan | Rome | 2 |
With SQL Server I generated all the possible segments for a route and then I counted tickets besed on ticket and segment range intersection.
Can I do this with DAX or just import the View (which might get quite large for Dual or Import mode)?
Off the cuff, this seems like it has an element of Transitive Closure. https://community.powerbi.com/t5/Quick-Measures-Gallery/Transitive-Closure/m-p/783828#M388
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
78 | |
77 | |
59 | |
36 | |
33 |
User | Count |
---|---|
100 | |
62 | |
56 | |
48 | |
41 |