Forum Discussion
Time Filter Slicer
- 2 months ago
Hi Sharvari2102,
You should Convert your time column to an integer (minutes since midnight) and use the numeric range slicer (Between mode). This gives users two clean input boxes, exactly like the screenshot you shared, without scrolling or search workarounds.
Here's what you can do step by step:
Step 1 Create a calculated column or transform in Power Query:
Time As Minutes = Hour([TimeColumn]) * 60 + Minute([TimeColumn])
Step 2: Add a Numeric Range Slicer on Time As Minutes, set to Between.
Step 3: Adapt your measure to work with the integer range:
Records Outside Range =
VAR StartMin = MIN('Slicer'[Time As Minutes])
VAR EndMin = MAX('Slicer'[Time As Minutes])
RETURN
CALCULATE(
COUNTROWS('YourTable'),
'YourTable'[Time As Minutes] < StartMin
|| 'YourTable'[Time As Minutes] > EndMin
)
Step 4 (optional): format display labels using a helper measure so axis/tooltip shows HH:MM instead of raw integers:
Format Minutes =
VAR M = SELECTEDVALUE('YourTable'[Time As Minutes])
RETURN
FORMAT(TIME(INT(M/60), MOD(M,60), 0), "HH:MM")
Hope this helps! Don't forget to accept as solution and give a like in order to keep helping others.
Best regards,
Oussama (Data Consultant - Expert Fabric & Power BI)
Hi,
For time-based filtering, the standard slicer can become difficult to use because users must scroll through many values. Since you need flexible Start/End time selection and have measures that depend on the selected range, here are some better approaches:
Option 1: Between slicer (Recommended if using DateTime)
If your column is DateTime, try using the “Between” slicer.
- Convert your time column to a proper DateTime datatype (if possible)
- Add it to a slicer
- Change slicer type to Between
This gives users a much cleaner range selection experience.
Option 2: Disconnected Time Table (Best for flexibility)
Create a separate Time Dimension table (for example every 15 or 30 minutes) and use two slicers:
- Start Time slicer
- End Time slicer
Example table:
TimeTable =
ADDCOLUMNS(
GENERATESERIES(0, 1439, 15),
"Time", TIME(INT([Value]/60), MOD([Value],60), 0)
)
Then create measures using:
SelectedStart =
SELECTEDVALUE(TimeTable[Time])
SelectedEnd =
SELECTEDVALUE(TimeTable2[Time])
This works very well when you need calculations like:
- Records inside selected range
- Records outside selected range
- Custom filtering logic
and gives a much better UX than scrolling through a long slicer list.
Option 3: Custom Visuals
You could also try custom visuals such as:
- Timeline Slicer
- Time Picker / Time Range slicers from AppSource
Some of these provide a more intuitive experience for selecting hours/minutes.
From your screenshot, it looks like you're already using separate Start Time / End Time dropdowns — in that case, I’d recommend the disconnected time table approach, as it gives full control and works nicely with custom measures.
Hope this helps!
Thanks!