Forum Discussion

Sharvari2102's avatar
Sharvari2102
Regular Visitor
2 months ago
Solved

Time Filter Slicer

Hello everyone,

I am currently working on a Power BI dashboard where I need to filter data based on time.

At the moment, I’m using a standard slicer on a time column, but it is not very user-friendly since users have to scroll through a large number of time values. I also tried enabling the search option, but it doesn’t work efficiently for this use case.

Additionally, I have a measure that calculates the number of records outside the selected time range, so the slicing logic needs to remain flexible (custom start/end time selection).

I wanted to check if there are better alternatives or visuals that can improve the user experience while still supporting this kind of filtering logic.

  • Has anyone implemented a more user-friendly approach for time-based filtering?
  • Are there recommended visuals (native or custom) for this scenario?

Any suggestions or best practices would be really helpful.

Thanks in advance!

  • 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)

7 Replies

  • 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!

  • Sharvari2102 

     

    Use two single select dropdown slicers, one Start Time and one End Time, off a disconnected time table. Capture each with SELECTEDVALUE and feed them into your filtering logic and your "outside range" measure.

    StartSel = SELECTEDVALUE('TimeTable'[Time])


    Cleaner than one long scrolling slicer and keeps your custom range logic flexible.

  • 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)

  • Using Time in a slicer is one of Power BI's weak points as although you can use a range slicer, the start and end values that appear are dates instead of time so using a range slicer is out of question unless you're want to use the hour equivalent of  your time (eg 23.5 for 11:30PM). Also, the approach will depend whether your time is start and end times are from the same column or from two different columns. Either you might end up with using disconnected tables and a dropdown instead.

  • ryan654321's avatar
    ryan654321
    Frequent Visitor
    Hi  Sharvari2102 
    I hope the answers provided helped resolve your issue.

    If our solution was helpful, could you please mark it as the accepted solution? This will help other community members facing a similar situation find the solution more easily.
     
    Was this reply helpful?YesNo
  • v-anbandari's avatar
    v-anbandari
    Community Support

    Hi Sharvari2102,

    Thank you for posting your query in the Microsoft Fabric Community Forum.

    Could you please confirm if your issue has been resolved using the suggested approach? This will help other community members facing similar scenarios.
     

    Thank you for being part of the Microsoft Fabric Community.

  • v-anbandari's avatar
    v-anbandari
    Community Support

    Hi Sharvari2102,

    Just checking in again on your issue. Could you please confirm if the solution worked?

    Please let us know if you need any further assistance.Your update will be valuable to the community and may assist others with similar concerns.

    Thank you.