Forum Discussion

nothingman's avatar
nothingman
Regular Visitor
8 years ago

Get slicer value after disabling interactions

I have a bar chart and date slicer and I disabled interaction between those two. However I would like to have possibility to reference the actual value in a slicer in a measure used with the bar chart. Is there some DAX function that would allow me to achieve this? 

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    I had a similar issue and I couldn't find an answer on this forum. In my scenario, I wanted to retrieve a selected Date while having interactions between visualizations turned off.

     

    Here's the link that helped me greatly. The idea is to create a separate (disconnected) table with all unique Dates and use this field as a slicer. Afterwards, creating a measure with SELECTEDVALUE referencing this new Date field is very straightforward.

    https://www.blue-granite.com/blog/disconnected-table-power-bi

    • nothingman's avatar
      nothingman
      Regular Visitor

      The function that you've proposed doesn't work because the interaction between slicer and bar chart is turned off so SELECTEDVALUE sees all values in the date column. This is my main issue - how to get a reference to value selected on a slicer even though the interaction is turned off

      • ricardocamargos's avatar
        ricardocamargos
        Continued Contributor

        Hi nothingman,

         

        You can use:

         

        If you are using the "between" option:

        First selected value = CALCULATE(FIRSTDATE(DIM_DATA_2[Date]); ALLSELECTED())

        Last selected value = CALCULATE(LASTDATE(DIM_DATA_2[Date]); ALLSELECTED())

         

        If you are using the "list" option you can do like Zubair_Muhammad said:

        SELECTEDVALUE(DIM_DATA_2[Date]).

         

         

        Ricardo