Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Select value from slicer in another table and use in filter

Hi,

 

I'd like to ask for help please.

 

I have a table table1 which contains "Sprint name" column and is used in slicer.

 

I have another table table2 which is summarized/filter from table1. I want to use the selectedvalue from slicer to be able to filter my table2 but with a different value:

filter(table2, table2[index] <= (select index from table2 where [table2]sprintname = selectedvalue(table1[sprintname]))

 

I'm not certain how to do the one in bold. When i create a var as part of table2 query:

var sprintName = selectedvalue(table1[sprintname]) <- this one doesnt seem to pick up any value

 

but when i create a measure under table2, i am able to get the selectedvalue but i'm not able to access it as filter in the table2 query (where measure was created). 

 

Thanks so much!

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Have you tried just =, instead of <=? The SelectedValue is a text value, right?

     

    --Nate

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi! Unfortnulately, no that doesn't work.

       

      I wanted to filter may table2 based on the selected value from slicer in table1

       

      If I hard code sprint name below it works:

      Table2 =
      VAR Result = SUMMARIZE(FILTER('Table1', some filters), 'Table1'[Sprint Name], 'Table1'[Iteration Start Date])
      VAR FilteredResult = FILTER(Result, 'Table1'[Sprint Name] <= "Sprint 17")
      Return FilteredResult

      If i don't hard code, and get value from measure or selectedValue from table1, it doesn't work.
      How can I get selectedvalue from slicer from table1?
       
      Thanks so much!
      • v-yingjl's avatar
        v-yingjl
        Icon for Community Support rankCommunity Support

        Hi Anonymous ,

        Currently it is not supported to pass selected slicer values to a calculated table in Power BI, use selectedvalue() would return all blank value. 

        If write like calculate(max('Table'[Name]),allselected('Table')), it would return the max name value from the table.

         

        You have need to make hard code for the calculated table to filter it.

         

        Best Regards,
        Community Support Team _ Yingjie Li
        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.