Forum Discussion
Using SELECTEDVALUE() for lookup in different table
- Anonymous2 years ago
Hi Anonymous ,
The Table data is shown below:
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
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.
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
- Anonymous2 years agoNot 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
col0 col1 235505 F8769 232641 F6453 232641 F1938 232641 F3275 244413 F4560 244413 F1253 246787 F5412 232648 F6023 232648 F5643 Table2
col2 col3 F4560 2545 F4365 2531 F5643 2552 F6539 2609 F1209 2636 F4532 2614 F1938 2437 F6578 2546 F5490 2631 - Anonymous2 years agoNot applicable
Hi Anonymous ,
The Table data is shown below:
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
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.