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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mattkocak
Kudo Kingpin
Kudo Kingpin

Slider Slicer that Includes Time (Not just Date)

Hey all,

 

I have a Time column that I would like to create a slider slicer for, similar to what's available for a Date column.

 

tetra_matt_1-1654870155159.png

 

However, I haven't been able to find a way to do this. If I add a Time column to a slicer and set the visualization method to "Between", it shows a 1899-12-30 date without any other options. As an FYI, all of my data is within a 24-hour period so duplicate times on different dates are not an issue.

 

tetra_matt_0-1654869696976.png

 

Similarly, if I do this with a Date/time column instead of just a Time column, it simply uses the date piece of the value and leaves off the time piece.

 

tetra_matt_3-1654870881867.png

 

I know that one can add a "zoom slider" to some individual visuals to create a similar effect, but I need to actually slice the data based on time, not just adjust the visual display.

 

Is there a way to implement a slider slicer based on the time piece?

 

Best,

Matt

2 ACCEPTED SOLUTIONS
lbendlin
Super User
Super User

No, that is not possible. Use the filter pane instead.

View solution in original post

raymcgaw
Frequent Visitor

I was able to make a time slicer, but it was indepentent of the date, so you would first have to filter the date and then the time.

 

In power query, I split the time and minutes from the timedate into text, then converted back into a number (the minutes need to be padded with a zero):


Number.From(
Text.From(Time.Hour([Timestamp_Time])) &
Text.PadStart(Text.From(Time.Minute([Timestamp_Time])), 2, "0" ))

raymcgaw_0-1691511917186.png

 

I created a slicer with the number in it (used Greater than or equal to, but Between also works):

raymcgaw_1-1691512371614.png

 

To get it to look like time, I formatted the number to 0#:##

raymcgaw_2-1691512412997.png

 

 

View solution in original post

8 REPLIES 8
raymcgaw
Frequent Visitor

I was able to make a time slicer, but it was indepentent of the date, so you would first have to filter the date and then the time.

 

In power query, I split the time and minutes from the timedate into text, then converted back into a number (the minutes need to be padded with a zero):


Number.From(
Text.From(Time.Hour([Timestamp_Time])) &
Text.PadStart(Text.From(Time.Minute([Timestamp_Time])), 2, "0" ))

raymcgaw_0-1691511917186.png

 

I created a slicer with the number in it (used Greater than or equal to, but Between also works):

raymcgaw_1-1691512371614.png

 

To get it to look like time, I formatted the number to 0#:##

raymcgaw_2-1691512412997.png

 

 

can you please elaborate the process in step by step in Power BI ?

 

Hi raymcgaw, thanks for the sweet solution, but how did you format the slicer? In powerBi I can't find the settings you posted for formatting the new number. 

Select the field in the data pane and then go to Column Tools, the format option will be in the main ribbon:

 

raymcgaw_0-1707496026784.png

 

First off, thanks for posting your solution.

 

In implementing your solution, the time slicer show "times" like 01:80.  Were you able to bound in some way what values the number slicer values could show for "minutes" i.e. 00-59?

Just to note, this is just a mask for a number and the way the slicer works is by giving you all numbers in a range.  While 01:80 is not a valid time, it is still filtering the correct range since there will be no time (number) in your dataset greater than 0159 until you get to 0200.  I have done some workarounds below until there is a proper solution:

 

If you are able to limit your slicer within a fixed hour period (ex. 10:00 - 10:59), you can force the values by adjusting the filters of the number.

If you are slicing times greater than a one hour block (ex. 10:00 to 13:00), then I would suggest removing the slider part of the slicer and just have manual inputs (make sure users know it is 24-hour formatted).  

Cool, a very clever solution!

lbendlin
Super User
Super User

No, that is not possible. Use the filter pane instead.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.