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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

When value is present in column, find matching value on another row and supply another column value

Hello,

 

I'm attempting to make a DAX that uses the member_id in the reports_to column, to lookup the title for that member ID so I can make a dynamic grouping based on Title of the member_id that people report to.

 

member_idReports_ToTitle
Nhamilton Business Manager
BMamrakNHamiltonAdmin
LGlickmanNHamiltonAdmin
MHollandNHamiltonAdmin
SPrice2NHamiltonAdmin

 

This is just a small sample from the dataset, please let me know if I can help with any additional details.

 

Thanks,

Seth

2 ACCEPTED SOLUTIONS
Greg_Deckler
Super User
Super User

Not sure I am 100% following but generally LOOKUPVALUE or MAXX(FILTER(...)...)



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

Anonymous
Not applicable

@Greg_Deckler 

 

That gave me the same result for all rows. I figured it out with LOOKUPVALUE, I had one of the columns in the wrong place, when switched it properly had a single value and returned what I was looking for.

 
Column = LOOKUPVALUE(v_rpt_Member[Title],v_rpt_Member[Member_ID],v_rpt_Member[Reports_To])

 

Thanks for the original answer and help with this!

View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

The information you have provided is not making the problem clear to me. Can you please explain with an example.

Appreciate your Kudos.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Greg_Deckler
Super User
Super User

Not sure I am 100% following but generally LOOKUPVALUE or MAXX(FILTER(...)...)



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler 

 

I tried the below, but getting "a table of multiple values was supplied where a single value was expected"

 

LOOKUPVALUE(v_rpt_Member[Title],v_rpt_Member[Reports_To],v_rpt_Member[Member_ID])
 
I'm trying to create a new column that basically has the "Title of reports to" or the title of the person they report to. My dataset has 492 rows with numerous different reports_to values, so that initial table is a small snippet. 
 
This is the result I would like to see (red text is new column that does not yet exist), and have it dynamically lookup the Title so that when folks change roles it uses the new reports_to member_id to lookup title.
 
member_idReports_ToTitleTitle of Reports_to
Nhamilton Business Manager 
BMamrakNHamiltonAdminBusiness Manager
LGlickmanNHamiltonAdminBusiness Manager
MHollandNHamiltonAdminBusiness Manager
SPrice2NHamiltonAdminBusiness Manager
Jclark Sales Director 
ScalkinsJclarksalesSales Director
AkoonJclarksalesSales Director

 

Hope that helps clarify what I'm trying to accomplish. Thanks for your help.

 

 

Hmm, maybe:

 

Column = 
  MAXX(FILTER('Table',[member_id] = [Reports_To]),[Title])

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler 

 

That gave me the same result for all rows. I figured it out with LOOKUPVALUE, I had one of the columns in the wrong place, when switched it properly had a single value and returned what I was looking for.

 
Column = LOOKUPVALUE(v_rpt_Member[Title],v_rpt_Member[Member_ID],v_rpt_Member[Reports_To])

 

Thanks for the original answer and help with this!

Sorry, guess I should have actually tested that code! :S


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.