cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nghtwlker17
Helper I
Helper I

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 IV
Super User IV

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


---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

@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 IV
Super User IV

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

Appreciate your Kudos.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Greg_Deckler
Super User IV
Super User IV

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


---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

@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!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@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

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

---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Get Ready for Power BI Dev Camp

Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors