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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Table with Multiple User Unique ID's to Lookup Table

Hey guys so I have a product table that I need to connect to a User table because the product table will say the person's ID not their name. But the catch is that the product table has multiple users in it. Currently, I am just duplicating the User table as many times as I need it.

Example:

 

Product Table:

Product IDUserTeam LeadManager

2

asb1asb2asb3
3asbhasbh2asbh3

 

User Table:

User:Name:
asb1Devin Howard
asbhJohnny Smith
asb2Howard Levin

 

I cant create multiple connections to the user table off User, Team Lead, Manager because Power BI automatically makes any multiple inactive. I am wondering if there is a way to basically mask all of their User ID's?

 

3 ACCEPTED SOLUTIONS
Ashish_Mathur
Super User
Super User

Hi,

I think the first table should be transformed into a 3 column Table - Product ID, Attribute and Value.  The Attribute will have User, Team Lead and Manager and the value column will have the user names.  This can be done in the Query Editor using the "Unpivot Other columns" feature.  Then you can build a relationship from the Value column of Table1 to the User column of Table2.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Besides of Ashish_Mathur 's suggestion,

Leave the tables no relationship, create measures/columns in "product"table,

Capture7.JPGCapture8.JPG

Measure_user = LOOKUPVALUE(Table2[Name],Table2[User],MAX(Table1[User]))

Measure_team = LOOKUPVALUE(Table2[Name],Table2[User],MAX(Table1[Team Lead]))

Measure_manager = LOOKUPVALUE(Table2[Name],Table2[User],MAX(Table1[Manager]))

Column_user = LOOKUPVALUE(Table2[Name],Table2[User],Table1[User])

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Here is an example of Ashish_Mathur's suggestion:

Unpivot columns "User","team leader","manager" in Edit queries,

close&&apply, create relationnships,

add column from two tables in a matrix.

Capture9.1.JPGCapture9.8.JPGCapture10.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

@Ashish_Mathur @v-juanli-msft Thank you all so much! I just got back to this at work thank you it worked for me 🙂 I used the column idea because it was quick but they all work.

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Here is an example of Ashish_Mathur's suggestion:

Unpivot columns "User","team leader","manager" in Edit queries,

close&&apply, create relationnships,

add column from two tables in a matrix.

Capture9.1.JPGCapture9.8.JPGCapture10.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Besides of Ashish_Mathur 's suggestion,

Leave the tables no relationship, create measures/columns in "product"table,

Capture7.JPGCapture8.JPG

Measure_user = LOOKUPVALUE(Table2[Name],Table2[User],MAX(Table1[User]))

Measure_team = LOOKUPVALUE(Table2[Name],Table2[User],MAX(Table1[Team Lead]))

Measure_manager = LOOKUPVALUE(Table2[Name],Table2[User],MAX(Table1[Manager]))

Column_user = LOOKUPVALUE(Table2[Name],Table2[User],Table1[User])

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Ashish_Mathur
Super User
Super User

Hi,

I think the first table should be transformed into a 3 column Table - Product ID, Attribute and Value.  The Attribute will have User, Team Lead and Manager and the value column will have the user names.  This can be done in the Query Editor using the "Unpivot Other columns" feature.  Then you can build a relationship from the Value column of Table1 to the User column of Table2.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Thank you for your reply!

 

I don't think this will work because there are like 100 other columns in the user table and I have to sum some of those columns. 

Hi,

You are welcome.  The number of column on the first table does not matter.  We are carrying out the transformation on the first table.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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