cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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(...)...)


@ 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!:
Mastering Power BI 2nd Edition

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.

Greg_Deckler
Super User
Super User

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


@ 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!:
Mastering Power BI 2nd Edition

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])

 


@ 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!:
Mastering Power BI 2nd Edition

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

@ 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!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors