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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
PhineasT
Helper I
Helper I

Create Date Time and Shortest Wait Time Measures

I am working on a dashboard that provides various Date and Time outputs.

I need to create a measure or two that will show the 'Date and Time' (in one) associated with the 'Shortest Wait Time' (in the other) during that day.

I need the same for the 'Week' and the 'Month'. 

Desired Output -

PhineasT_0-1682783912558.png

 

Sample Data -

TicketNumberTicketDateInTimeOutTimeWaitTime
(hh:mm:ss)
S286/3/20197:03 AM7:36 AM0:33:16
S1116/3/20197:03 AM  
S1126/3/20197:04 AM7:28 AM0:24:29
S2106/3/20197:04 AM1:48 PM6:44:29
S2130527/8/20192:06 PM2:18 PM0:11:54
S149517/8/20192:07 PM2:22 PM0:15:33
S2130537/8/20192:07 PM2:33 PM0:25:47
S2130547/8/20192:08 PM2:46 PM0:38:36
S2336968/30/20194:07 PM4:27 PM0:20:27
S2336978/30/20194:08 PM4:34 PM0:25:49
S1109228/30/20194:08 PM  
S2336988/30/20194:09 PM4:28 PM0:19:47


Current Filter Matrix in Dashboard -

PhineasT_1-1682784376530.png

 

1 ACCEPTED SOLUTION

11 REPLIES 11
lbendlin
Super User
Super User

you may want to rethink your data structure. As it is it cannot handle tickets that are open across day boundaries. "Ticket Date"  should be eliminated, and "In Time"  and "Out Time" should be renamed "In DateTime" and "Out DateTime".

And then what?

Also, I don't understand your comment..."As it is it cannot handle tickets that are open across day boundaries."

I merely want a card that contains the date and time (just the date in MM-DD-YYYY form will do), and another card that contains the shortest wait time on that date and the time of day of that Shortest wait time. 

Let's say the "In Time" for a ticket is 11:55pm and the "Out Time"  is 02:05am.

Let's assume such an occurence is not possible. 

That all actions happen within a 24 hour period, with most happening between 04:00 and 20:00.

Seems I should be able to click on a calendar slicer - picking a day/date; There may be hundreds of 'Tickets' on that date/date. This action should populate card with the 'Shortest Wait Time' on that given day/date.

Is this not possible?

Something like this, except the desired ouput is 'Shortest Wait Time' rather than 'Earliest Start'.

Earliest Start =
MINX (
    CALCULATETABLE (
        Table_Roster,
        ALLEXCEPT ( Table_Roster, Table_Roster[Date], Table_Roster[Name] )
    ),
    Table_Roster[Start]
)

  

Create a table variable (via SUMMARIZE)  of the tickets for the current filter context, include the ticket duration  (probably ignore the tickets without end time),  and then do a MINX on that table variable.

Beyond my skill set.

Can you provide, or do you have a link to, an example of what your are recommending?

lbendlin_0-1682816543401.png

 

Here is my first attempt.

The actual 'Shortest Wait Time' for the date chosen (Sept. 19, 2020) is 00:16.49 (hh:mm:ss); However, the measure returns 12:16:00.

Did I do something wrong, or do I need to change something so that the output is 00:16:49?

PowerBI Visuals1.JPGPowerBI Visuals2.JPG

 

Data Source -

PhineasT_0-1682821052960.png

 

Use the FORMAT function to tame that datetime value into a duration value.

Thank you for your continued assistance.

I fiddled around with it some more this morning. This is what I have now; While being unsure of all of the 'best practices' and such.

Please, let me know, if you would, if anything stands out to you as potentially troublesome.

Default View -

PhineasT_0-1682874965595.png

 

View with TicketNumber 'S16' chosen in the table visual -

PhineasT_1-1682875045550.png

- the slicers could move to the filter pane

- the day cards could benefit from a small multiples approach

- the bottom left two charts don't carry a lot of information and should be replaced with something more insightful.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.