Forum Discussion

alexa_0028's avatar
alexa_0028
Icon for Resolver II rankResolver II
4 years ago
Solved

Select specific column in a table based on filter from static unrelated table

Hi All,

Please see below diagram for detail :

Requirement
:  My requirement is when I select code name in the static table , the product_name with code gets displayed in the table.

GIVEN : I have static table with list of codes and code name.
I have a table with product_key and product_name  in different codes
These 2 tables are not linked.

WHEN : When I choose filter on code name like below "Italy" the highlighted value should appear in Product Name Table.

Please help me to achieve this in Power BI.
I am really stuck here and looking for possible alternatives.


Thanks in advance.

 

  • Hi alexa_0028 ,

     

    You can create this measure:

    Switch =
    SWITCH(TRUE(),
    SELECTEDVALUE('Static Table'[Code Name])="Italy",SELECTEDVALUE('Product Name Table'[Product_Name_IT]),
    SELECTEDVALUE('Static Table'[Code Name])="Spanish",SELECTEDVALUE('Product Name Table'[Product_Name_ES]),
    SELECTEDVALUE('Static Table'[Code Name])="German",SELECTEDVALUE('Product Name Table'[Product_Name_G]),
    SELECTEDVALUE('Static Table'[Code Name])="English",SELECTEDVALUE('Product Name Table'[Product_Name_EN]))
     
    Result:

     

     

    Jori

     

    If I answered your question, please mark it as a solution to help other members find it more quickly.

2 Replies

  • jppv20's avatar
    jppv20
    Icon for Solution Sage rankSolution Sage

    Hi alexa_0028 ,

     

    You can create this measure:

    Switch =
    SWITCH(TRUE(),
    SELECTEDVALUE('Static Table'[Code Name])="Italy",SELECTEDVALUE('Product Name Table'[Product_Name_IT]),
    SELECTEDVALUE('Static Table'[Code Name])="Spanish",SELECTEDVALUE('Product Name Table'[Product_Name_ES]),
    SELECTEDVALUE('Static Table'[Code Name])="German",SELECTEDVALUE('Product Name Table'[Product_Name_G]),
    SELECTEDVALUE('Static Table'[Code Name])="English",SELECTEDVALUE('Product Name Table'[Product_Name_EN]))
     
    Result:

     

     

    Jori

     

    If I answered your question, please mark it as a solution to help other members find it more quickly.

  • Hi jppv20 

    Thank you so much for your quick reply.
    This solution worked like a charm for me. A big Kudos to you.

    Thank you so much again !!