Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

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: 

 

power_newbie1_0-1720101332223.png

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:

power_newbie1_1-1720103886340.png

 

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. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

The Table data is shown below:

vzhouwenmsft_0-1720163581577.png

vzhouwenmsft_1-1720163597693.png

Use the following DAX expression to create a measure

SELECTEDVALUE function - DAX | Microsoft Learn

LOOKUPVALUE function (DAX) - DAX | Microsoft Learn

Measure = 
VAR _col1ForSlicer = SELECTEDVALUE(Table1[col1])
RETURN 
LOOKUPVALUE(Table2[col3],Table2[col2],_col1ForSlicer)

Final output

vzhouwenmsft_2-1720163666910.png

If the problem persists, could you please share your .pbix file without sensitive data?

 

Best Regards,
Wenbin Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
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

Anonymous
Not applicable

Hi @Anonymous ,

Can you share the data of 'Table1'? Or a .PBIX file without sensitive data?

How to provide sample data in the Power BI Forum - Microsoft Fabric Community

 

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
Not applicable

Hi @Anonymous ,

 

The Table data is shown below:

vzhouwenmsft_0-1720163581577.png

vzhouwenmsft_1-1720163597693.png

Use the following DAX expression to create a measure

SELECTEDVALUE function - DAX | Microsoft Learn

LOOKUPVALUE function (DAX) - DAX | Microsoft Learn

Measure = 
VAR _col1ForSlicer = SELECTEDVALUE(Table1[col1])
RETURN 
LOOKUPVALUE(Table2[col3],Table2[col2],_col1ForSlicer)

Final output

vzhouwenmsft_2-1720163666910.png

If the problem persists, could you please share your .pbix file without sensitive data?

 

Best Regards,
Wenbin Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

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

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.