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.
Hi,
I have two tables, one containing all users with their properties, including their roles.
The other table is used to record a type of operation done for a user, which has its own properties including the ID of the user who did it.
Both tables are related through the user ID.
For a report, I need to display :
User ID - Operator ID - Operator role
For the user ID, I use user.id. For operator ID, I use operation.operatorId. Then if I try to use user.role, it displays the role of the user while I want to display the role of the operator.
I figured I should add a new column in table operation which would reference the table user and the field role, and that it would display the role of the operator. But I have no idea of how to do that. Can someone help?
Thanks
Solved! Go to Solution.
@VincentA , You can got from 1 to many side
new column = related(Table2[role])
Many to one
New column = maxx(realtedtable(Table1), Table1[role])
refer 4 ways to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8
It worked with the LOOKUPVALUE function! Thank you for your videos!
What I did :
@VincentA , You can got from 1 to many side
new column = related(Table2[role])
Many to one
New column = maxx(realtedtable(Table1), Table1[role])
refer 4 ways to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8
Sorry, I don't understand what you mean by "one to many"/"many to one"?
I tried using the "RELATED" function since I read it in many posts but none of the examples work, it seems to only accept Power Query functions
Oh, I get it now from your videos. How to use that with a table name that has spaces?"
I'm not getting it, I used the MAXX(RELATEDTABLE part but it always gives the same value. I want the value of the column to be relative to the user ID
It worked with the LOOKUPVALUE function! Thank you for your videos!
What I did :
Hi @VincentA
Could you share the headers of both tables, that would make it easier to suggest a solution
Yes, here it is for user table
id | name | email | etc | role
And for the operation table
id | status | protocol | operatorId | userId
userId = the ID of the user for who the operation was done
operatorId = the ID of the user who did the operation
Both ID are related in the source DB to the user table
Hi @VincentA
You can also acheive your result in Power Query by merging both tables using the column id
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |