Forum Discussion

Omesh's avatar
Omesh
Icon for Helper I rankHelper I
2 years ago
Solved

Hi Experts, Need help in slicer

I have a values in the slicer as displayed in a table, and there are two slicers, Slicer 1 and Slicer 2. Slicer 1 has an interaction with Slicer 2, but not the other way around. Initially, Slicer 1 i...
  • OwenAuger's avatar
    2 years ago

    Hi Omesh 

    Slicers can't natively "reset" when their selection becomes invalid.

    However, there is a workaround involving field parameters. I have attached a small example.

    I have assumed Slicer 1 & Slicer 2 only allow single selection. This can be relaxed for Slicer 2 without changing anything, but if relaxed for Slicer 1 it complicates things.

     

    The basic idea is:

    1. SlicerTable contains the original columns Slicer 1 & Slicer 2.
    2. Create a new 'Slicer 2' table that contains one column per distinct value of Slicer 1 (3 in this example). These columns are identical and each contains the distinct values of Slicer 2.
    3. Create a 'Slicer 2 Field Parameter' that allows selection of the 3 columns of 'Slicer 2', with a column corresponding to the values of Slicer 1.
    4. Create a bi-directional 1:many relationship from 'Slicer 2' to SlicerTable.
    5. On the report page:
      1. Slicer 1 slicer uses SlicerTable[Slicer 1]
      2. Slicer 2 slicer uses 'Slicer 2 Field Parameter'[Slicer 2 Parameter]
      3. There is a hidden slicer using 'Slicer 2 Field Parameter'[Slicer 1] that is synced with the main Slicer 1 slicer.
    6. Now, whenever the selection on Slicer 1 is changed, the Slicer 2 slicer will reset. If single-select is enabled, it will reset to the first available value.

     

     

    Please take a look at attached PBIX and see if that helps 🙂

     

    Regards