Forum Discussion

WishAskedSooner's avatar
WishAskedSooner
Continued Contributor
10 months ago
Solved

Duplicate Slicer Question

HI Experts!

 

I have a slicer for Annual, Quarterly, and Monthly, and I want to re-use the slicer on the same page but make the slicers independent e.g. Slicer A: Annual and Slicer B: Monthly.

 

This is trivial by just turning off the interactions. However, now I need to write a measure that returns the selected value for each Slicer. Is there a way to do this?

 

Something tells me this is not possible, but I am hoping I am wrong.

 

TIA

  • Slicers filter the entire data model, so you can't get independent selections from two slicers on the same column.

     

    The workaround: Create a separate disconnected table for your second frequency (Annual/Quarterly/Monthly). Use that table for your second slicer, then use SELECTEDVALUE on that disconnected table in your measure.

     

    SlicerA_Selection = SELECTEDVALUE('FrequencyTable'[Frequency])
    SlicerB_Selection = SELECTEDVALUE('DisconnectedFrequencyTable'[Frequency])

     

     

4 Replies

  • Slicers filter the entire data model, so you can't get independent selections from two slicers on the same column.

     

    The workaround: Create a separate disconnected table for your second frequency (Annual/Quarterly/Monthly). Use that table for your second slicer, then use SELECTEDVALUE on that disconnected table in your measure.

     

    SlicerA_Selection = SELECTEDVALUE('FrequencyTable'[Frequency])
    SlicerB_Selection = SELECTEDVALUE('DisconnectedFrequencyTable'[Frequency])

     

     

    • WishAskedSooner's avatar
      WishAskedSooner
      Continued Contributor

      Kedar_Pande,

       

      Thank you so much for your quick reply. I had a feeling that I would have to expand my Data Model which I was hoping to avoid. Ah well.

  • Indeed, as you are using the same column, you cannot use the SelectedValue formula, which returns the selected value in the column.

     

    One workaround would be to create a calculated column for your value (it's just a duplicate of your date column), which would allow you to use one column for each slicer. In this case, the SelectedValue would return the correct value for each.

     

    After that, you can create a measure like this one:

    Slicers Selection = SELECTEDVALUE('Table'[Date]) & "  - "&SELECTEDVALUE('Table'[DupplicateDate]) ...

    • WishAskedSooner's avatar
      WishAskedSooner
      Continued Contributor

      Cookistador,

       

      Thank you for your suggested workaround. A calculated column is definitely an easier workaround for me than a whole new table. Gonna try it now!