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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
RobWayne
Frequent Visitor

Lookup selected cell value from a range of columns and return a result

Hello to all the community,

I am trying to use DAX to return a result between two tables not directly connected between each other.

Table 1

NameJobLevel
AlanAccountantI
MarkAccountantII
JohnManagerIII

 

Job List

JobIIIIII
AccountantBCD
ManagerDEF

 

By taking the parameters Job + Level, I would like to return the corresponding value for each name based on level

Table 1

Name

JobLevelValue
AlanAccountantIB
MarkAccountantIIC

 

Current solution that I have found is to do a lot of nested lookupvalues 

IF(Level="I",LOOKUPVALUE('JOB LIST'[I],'JOB LIST'[JOB],Job),IF(Level="II",LOOKUPVALUE('JOB LIST'[II],'JOB LIST'[JOB],Job),IF(Level="III",LOOKUPVALUE('JOB LIST'[III],'JOB LIST'[JOB],Job),IF(Level="IV",LOOKUPVALUE('JOB LIST'[IV],'JOB LIST'[JOB],Job))))),LOOKUPVALUE('JOB LIST'[No Level],'JOB LIST'[JOB],Job)).
 
I would like to learn a more optimised way to do it,
I have tried by unpivoting of the columns but I am not sure how to write a condition to similar to IF ( Table1 [Job] + Table1 [Level] = Job List [Job] + Unpivot Job List [Level] )
Return Value
 
your clairvoyance and expertise is much appreciated
 
1 REPLY 1
dedelman_clng
Community Champion
Community Champion

Hi @RobWayne -

 

Unpivoting Job List is the first step. You want the data to look like this:

 

Job Level Value
Accountant I B
Accountant II C
Accountant III D
Manager I D
Manager II E
Manager III F

 

Then the DAX should be straightforward

 

JobValue =
LOOKUPVALUE (
    JobList[Value],
    JobList[Title], Table1[Title],
    JobList[Level], Table1[Level]
)

 

 

Hope this helps

David

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.