Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. 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!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 9 | |
| 6 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 22 | |
| 14 | |
| 10 | |
| 6 | |
| 5 |