Forum Discussion

Aparimita's avatar
Aparimita
New Member
3 months ago
Solved

Between Date Slicer

Is there anyway in Power BI to keep a Between slicer blank by default (without any start date and end date selected), so that users can manually choose dates only when needed?   Alternatively can w...
  • pcoley's avatar
    3 months ago

    Aparimita  As i know, by now, there isn't a straightforward built-in way to keep a native "Between" date slicer completely blank by default (with both start and end empty) in Power BI. The Between style almost always defaults to the min/max dates from your data (or the last published selection), and you can't natively force it to stay empty without user interaction.

    Power BI treats the Between slicer as requiring a valid range once interacted with, and saved/published states persist.

    Best Workarounds for "Blank by Default" or "Only Filter When Needed":

    1. Use a Relative Date Slicer (Recommended for many cases)
      • Change the slicer Style to Relative Date.
      • This is dynamic (e.g., Last 30 days, This Month, etc.) and updates automatically every day without manual intervention.
      • Users can still adjust it. It's often the cleanest native option for time-based filtering.
    2. Disconnected Slicer + DAX Measures (Flexible but more work)
      • Create a disconnected date table (no relationship to your fact table).
      • Use this for the slicer.
      • In your measures, use logic like:
        dax
         
        Sales = 
        VAR MinDate = MIN('DisconnectedDate'[Date])
        VAR MaxDate = MAX('DisconnectedDate'[Date])
        RETURN
            CALCULATE(
                [YourBaseMeasure],
                'Fact'[Date] >= MinDate && 'Fact'[Date] <= MaxDate
            )
         
         
      • To handle "no selection" (show all or nothing): Use ISFILTERED or check if Min/Max are blank, and adjust the measure accordingly (e.g., return BLANK() or all data).
      • This gives full control but requires measure changes.
    3. Two Slicers + Bookmarks (Common UX Pattern)
      • One Relative Date slicer (hidden/shown as default).
      • One Between slicer for custom ranges.
      • Use bookmarks + buttons ("Default View" vs "Custom Dates") to switch between them and reset selections.
      • This lets users opt into custom filtering only when needed.
    4. Button Slicer or Other Visuals Newer visuals like the Button Slicer can support dynamic defaults (e.g., current month) more elegantly in some scenarios.

    Setting Dynamic Default (e.g., Start Date → Fixed, End Date → Today)

    This is also not directly supported on a native Between slicer (it won't auto-update the end date daily after publish), but here are solid approaches:

    • Use Relative Date Slicer — Set it to "Last N Days" or "This Period" for automatic daily updates.
    • Disconnected Table + Default via Bookmark/Measure — Create measures for default start/end (using TODAY()). Use a bookmark to apply a default selection on report open (or via a "Reset" button).
    • Power Query Trick for "Latest" — Add a custom column that labels the max date as "Latest" for easier defaulting.
    • Advanced Custom Approach — Some community solutions combine calculated tables, measures, and bookmarks to simulate dynamic defaults while allowing overrides.

    Note: After publishing, the slicer retains the last saved selection. To enforce a true "default," use bookmarks that reset on view or the methods above.

    Best Practices & Suggestions

    • Prefer Relative Date slicers for anything time-sensitive — they're dynamic by design.
    • Provide a "Reset to Default" button (bookmark) so users can easily go back to Today/YTD/Last 30 Days, etc.
    • Test thoroughly in the Service (behavior can differ slightly from Desktop).
    • For complex needs, consider a What-If parameter or custom visual from the marketplace, but native options + DAX cover most cases.
    • Document for users: Many prefer the flexibility of opting into date filters rather than always having a range applied.