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.
We have a report where you can select an origin and destination stop to calculate the average travel time between those stops using the measure below. Is there any way to speed up the measure? WkOperatingDayDate, TechnicalLineNumber, JourneyGid and VehicleIdentity uniquely identifies a journey and SequenceNumber is the ordinal number of a stop on the journey route.
AvgActualTravelDuration(s) =
VAR originStop = SELECTEDVALUE(OriginStopArea[StopAreaGid])
VAR destinationStop = SELECTEDVALUE(DestinationStopArea[StopAreaGid])
VAR originTable =
SELECTCOLUMNS(
CALCULATETABLE(
F_TravelStop,
D_StopArea[StopAreaGid]=originStop
),
"WkOperatingDayDate", [WkOperatingDayDate],
"TechnicalLineNumber", RELATED(D_Line[TechnicalLineNumber]),
"JourneyGid", [JourneyGid],
"VehicleIdentity", [VehicleIdentity],
"OriginSequenceNumber", [SequenceNumber],
"OriginActualTravelDurationRunningTotal", [ActualTravelDurationRunningTotal]
)
VAR destinationTable =
SELECTCOLUMNS(
CALCULATETABLE(
F_TravelStop,
D_StopArea[StopAreaGid]=destinationStop
),
"WkOperatingDayDate", [WkOperatingDayDate],
"TechnicalLineNumber", RELATED(D_Line[TechnicalLineNumber]),
"JourneyGid", [JourneyGid],
"VehicleIdentity", [VehicleIdentity],
"DestinationSequenceNumber", [SequenceNumber],
"DestinationActualTravelDurationRunningTotal", [ActualTravelDurationRunningTotal]
)
VAR joinedTable =
FILTER(
NATURALINNERJOIN(
originTable,
destinationTable
),
[OriginSequenceNumber] < [DestinationSequenceNumber]
)
RETURN
AVERAGEX(
joinedTable,
([DestinationActualTravelDurationRunningTotal] - [OriginActualTravelDurationRunningTotal]))
The first thing you should do is to download Dax Studio, an invaluable tool that will give you detailed feedback on how your measure executes https://daxstudio.org/
The next thing is to watch https://www.sqlbi.com/tv/my-power-bi-report-is-slow-what-should-i-do/....which will give you some good hints about possible improvements.
I'm a personal Power Bi Trainer I learn something every time I answer a question
The Golden Rules for Power BI
Help when you know. Ask when you don't!
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 |
---|---|
10 | |
8 | |
8 | |
8 | |
6 |
User | Count |
---|---|
14 | |
12 | |
11 | |
9 | |
9 |