Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Using SELECTEDVALUE() for lookup in different table

Hi Community! I have a question regarding the usage of the SELECTEDVALUE() function. I have created a measure Date as in the picture below: 

 

Table1 contains a column, col1, that has around 130 distinct values (strings). Table2 contains a column, col2, that has around 600k distinct values (strings) and includes all values in Table1[col1]. These tables are updated daily and imported as dataflows.

 

I would want to be able to select a value from a slicer (containing Table1[col1]), then find that value in the Table2[col2] column and return the associated value (y) from another column, col3, in Table2. I have no relationship between the two tables (there are lots of duplicates in Table1[col1]). It seems that I cant use the function SELECTEDVALUE() when trying to search in another table with a value that has been selected in a slicer (Slicer 2). See schematic picture below:

 

What I have done:

In my implementation so far, I have actually another slicer (Slicer 1) that contains another column (col0) in Table1. After selecting a value (z) from that slicer, I get the associated values (x's) in Table1[col1] in another slicer (Slicer 2). But then, when selecting a value (x1) from Slicer 2, I cant seem to catch that value with the SELECTVALUE() function, to be able to search in the other table, Table2. If I instead just type the string that should have been caught by SELECTEDVALUE() in the CONTAINS() function, it works. But not otherwise...

 

I have tried to create creating a new table containing the UNION of Table1[col1] and Table2[col2], and implementing a measure as in picture above. This seems to find a value when using SELECTEDVALUE() function but then there is still the problem of getting the associated value from col3 in Table2. 

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Sorry if my explanation is messy, I am thankfull for all tips I can get!

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Anonymous thank you for your reply. This is essentially what the tables contain. So I would for example want to select a value from column col0 (244413), which then slices the col1 (F4560, F1253), I select one of those from a new slicer. Then the selected value (e. g. F4560) get looked up in Table2[col2], and the associated value from col3 (2545) should be returned.

       

      Table1

      col0col1
      235505F8769
      232641F6453
      232641F1938
      232641F3275
      244413F4560
      244413F1253
      246787F5412
      232648F6023
      232648F5643

       

      Table2

      col2col3
      F45602545
      F43652531
      F56432552
      F65392609
      F12092636
      F45322614
      F19382437
      F65782546
      F54902631
  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    I saw you shared your .pbix file, but your reply has been deleted. If your problem has been solved, please mark my answer as the solution, thank you.

     

    Best Regards,
    Wenbin Zhou