Forum Discussion

powerbiexpert22's avatar
powerbiexpert22
Icon for Impactful Individual rankImpactful Individual
4 months ago
Solved

Slicer requirement

i have below requirement for vehicle model year slicer which should be drop-down list with single or multiple selections, how to achieve below slicer requirement in power bi?    Requirment:  User m...
  • Ritaf1983's avatar
    4 months ago

    Hi powerbiexpert22 

    There is no native option to force a slicer selection at the whole report/page level and automatically block all visuals from showing data. A common workaround is to handle this at the individual visual level.

    You can create a measure that checks whether the slicer field is filtered:

    Filtered check =
    IF (
    ISFILTERED ( 'Vehicle'[Model Year] ),
    1,
    0
    )

    Then add this measure to the visual-level filters of each visual that should be hidden, and set the filter to show only when Filtered check is 1.

    Also, if you do not want users to view the report by selecting all values, you should turn off the "Select all" option in the slicer.

    I would also recommend adding a clear instruction for the user, for example by using a dynamic title, card, or text message:

    User Instructions =
    IF (
    [Filtered check] = 1,
    "Regular title",
    "Please select at least one vehicle model year to view the report"
    )
    For reference you can refer to my example with city

    The pbix is attached

    If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

  • cengizhanarslan's avatar
    3 months ago

    Step 1) Create a guard measure:

    Selection Guard =
    IF (
        ISFILTERED ( 'Table'[ModelYear] ),
        1
    )

    Step 2) Add this measure as a visual-level filter on every visual in the page, set to is equal to 1. Visuals will be blank until the user makes a selection.

     

    Step 3) Create a warning Card using:

    Warning Message =
    IF (
        NOT ISFILTERED ( 'Table'[ModelYear] ),
        "Please select a Model Year to view the report."
    )

    Place this Card prominently on the page. It disappears automatically once the user selects a value.