Forum Discussion

oddarin's avatar
oddarin
New Member
3 years ago

Select values based on selection from non-related table

Hi,

I wonder if is it somehow possible to select values from table based on value from non-related table (or, in fact, related but not in a way needed in that task)?

I mean I have one table with some codes and I want to be able to show in report all rows from another table with the code selected in the first table, something like filter on TableB[code] = SELECTEDVALUE(TableA[code]). I tried to create some sort of a measure with variable but I'm a novice in PBI and I'm definitely doing something wrong, because whereas it seems as quite an easy task - simply pass and get the value, but nothing works for me

5 Replies

  • Arul's avatar
    Arul
    Icon for Super User rankSuper User

    oddarin ,

    It is possible. Can you please provide some sample data and expected output in the expected visual?

    Thanks,

    Arul

    • oddarin's avatar
      oddarin
      New Member

      Arul Thank you for the reply!

      I have that kind of data

      And I expect if I select vendor code in the first table, in second I'll see all orders with that vendor code

      So the main task is to pass the value of the selected code to use it for the filtration in the second table as if that two tables have actual relationship by vendor code (which they don't have)

      • Arul's avatar
        Arul
        Icon for Super User rankSuper User

        oddarin ,

        Based on my research so far I have achieved it through measure which you need to apply at visual level, before selection the visual will be blank but if you select any code in table it will display in table.

         

        Interaction = 
        VAR _values = VALUES('List 2'[Value])
        VAR _result = IF(SELECTEDVALUE('List 1'[Value]) IN _values,1,0)
        RETURN _result

         

         

        Thanks,

        Arul