Forum Discussion

VistaVega's avatar
VistaVega
Frequent Visitor
2 years ago
Solved

Getting slicer value with interaction turned off

Hi,

 

I've checked previous similar threads but they do not have an answer to my issue. I have a slicer that I use to filter a few visuals. I want to use that same slicer to highlight (but not filter!) the selected value in other visuals.

 

That's where the issue comes in: I haven't figured out how to still get the selected value of the slicer when interaction is turned off. Things like SELECTEDVALUE or a harvesting measure like MAX or AVERAGE doesn't work either.

 

Is it possible to get a slicer's selected value despite interaction with that slicer being turned off for the selected visual?

 

(Note: my current workaround is a second slicer with a disconnected highlight table in it to highlight the selected value, but I'd like to combine the functionality of both into a single slicer)

 

Thanks!

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi VistaVega ,
    Thanks for ajohnso2  reply.
    Based on my testing, it's true that you can't use the function to get the slicer value after disabling the interaction. However, you can use the slicer generated by the dimension table to emulate the function of the original field slicer.
    Here are some steps:
    Sample data

    Create a calendar table

    Calendar = CALENDAR( MIN('Table 1'[Date]),MAX('Table 1'[Date]))

    Create measures

    Measure = 
    IF(
        SELECTEDVALUE('Table 1'[Date]) IN VALUES('Calendar'[Date]),
        1,
        0
    )
    Measure 2 = 
    IF(
        SELECTEDVALUE('Table 1'[Date]) IN VALUES('Calendar'[Date]),
        "Red"
    )

    Apply measure to the filter of the visualization 1

    Apply the measure 2 to the conditon formatting of visualization 2

    Fianl output

     

    Best regards,
    Albert He

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

     

     

     

2 Replies

  • ajohnso2's avatar
    ajohnso2
    Solution Supplier

    Apologies if i have not understood your request.

    If you removed the slicer and instead dropped in say a table visual (using this as your 'slicer' instead), could you not setup interactivity between said table visual and your other visuals (setting the interactivity to Highlight rather than filter)

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi VistaVega ,
    Thanks for ajohnso2  reply.
    Based on my testing, it's true that you can't use the function to get the slicer value after disabling the interaction. However, you can use the slicer generated by the dimension table to emulate the function of the original field slicer.
    Here are some steps:
    Sample data

    Create a calendar table

    Calendar = CALENDAR( MIN('Table 1'[Date]),MAX('Table 1'[Date]))

    Create measures

    Measure = 
    IF(
        SELECTEDVALUE('Table 1'[Date]) IN VALUES('Calendar'[Date]),
        1,
        0
    )
    Measure 2 = 
    IF(
        SELECTEDVALUE('Table 1'[Date]) IN VALUES('Calendar'[Date]),
        "Red"
    )

    Apply measure to the filter of the visualization 1

    Apply the measure 2 to the conditon formatting of visualization 2

    Fianl output

     

    Best regards,
    Albert He

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