Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
RedDwarf_803
Frequent Visitor

Display (in a matrix) next available departure time of multiple bus services

Hi

If I have posted my question in the wrong forum just let me know and I correct my mistake.

Basic plot:
I want to display (in a matrix) next available departure time of multiple bus services that I based the arrival time of selected bus service on a selected bus stop.

My idea was to create two matrix visuals
Visual A:
Create a measure that displays the next departure time of each bus service
Visual B
Create a measure that calculate the time differences between (bus service) departure time from the selected bus service arrival time.


I’ve tried several DAX measures and now om stuck.
My try-outs have been as calculated measures.

By a slicer the user selects:
Operating date (one date)
StopAreaNumber (one single bus stop)
TechnicalLineNumber of the bus service that arrives to the bus stop.

Each bus service can have 1 or 2 directions (DirectionCode) of departure from the selected bus stop.

The expected result should look like this.

testDataForum - Excel.jpg



This I my latest result in the visual.
Red boxes/arrows display wrong departure time.
Green boxes shows correct data
PBIPic.jpg

My dax measure

NextDeparture = 
VAR currentDate = SELECTEDVALUE(TraficOnStopArea[OperatingDayDate])
VAR busStop = SELECTEDVALUE(TraficOnStopArea[StopAreaNumber])
VAR data = CALCULATETABLE(TraficOnStopArea, FILTER(TraficOnStopArea,TraficOnStopArea[OperatingDayDate].[Date] = currentDate &&  TraficOnStopArea[StopAreaNumber]= busStop))
VAR nextDepartureTime = MAXX(data,TraficOnStopArea[PlannedDepartureTime])


return
nextDepartureTime



The linked pbix file is just a small version of a larger dataset.
DataOnStop 

1 REPLY 1
RedDwarf_803
Frequent Visitor

Hi

I just realised that some data from arrival time/date some how got mixed up with departure time/date.
Apologize for the mistake
Here is a new file
DataOnStop 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.