non related table

Hi, I'm building a model in Power Pivot, and I've come across an issue I'm trying to resolve.  I have a column that contains either, a team ID or a User ID [table A]. 

I need to create a column that contains the Team ID for all rows.  I have a table containing the user ID, Team ID [table B], and I want to grab the Team ID from [table B] where the User ID [table A] = User ID [table B].

What's the best solution to create the Team column in [table A] ?

T

September 13th, 2015 8:37am

Hi Tim,

According to your description, you need to create a calculated column to display the TeamID from [table B] where the User ID [table A] = User ID [table B], right?

If that is the case, we can use the LOOKUPVALUE function to achieve your requirement.
LOOKUPVALUE( <result_columnName>, <search_columnName>, <search_value>[, <search_columnName>, <search_value>])
It returns the value in result_columnName for the row that meets all criteria specified by search_columnName and search_value. In your scenario, you can use the DAX expression below.
=LOOKUPVALUE(TableB[TeamID],TableB[UserID],TableA[UserID])

https://msdn.microsoft.com/en-us/library/gg492170.aspx?f=255&MSPPError=-2147217396

Regards,

Free Windows Admin Tool Kit Click here and download it now
September 14th, 2015 12:51am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics