Forum Discussion
Adding a new column to a table using data from another table
I have an existing table that I want to add a new column to, using specifically matched data from another table.
The table I want to add to is named 'Case'. The table I want to pull from is called 'User'.
I have an established relationship between 'User'[ID] and 'Case'[OwnerID] - visualizations work perfectly to resolve Case number to Case owner name for instance.
What I'd like to do is populate a new column in the 'Case' table that displays the 'User'[Name] field for each line (case number). I know I could build a conditional colum, but was hoping there was a better way to look up the value and populate
| "Case" | |
| Case_Number | OwnerID |
| 22234 | QRF24B34OP |
| 22235 | QRF24B956T |
| 22236 | QRF24BBF21 |
| 22237 | QRF24BP09J |
| "User" | |
| ID | Name |
| QRF24B34OP | Eric |
| QRF24B956T | Mary |
| QRF24BBF21 | Nassif |
| QRF24BP09J | Vu |
- Anonymous7 years ago
Doh! I realized my mistake. Forgot the ' around the table name.
CaseOwner = LOOKUPVALUE('User'[Name],'User'[Id],'Case'[OwnerId])
3 Replies
- ArunkumarKHelper I
The better way for this is lookup function.
I tried it by remembering the syntax so in case if any errors correct it accordingly. LOOKUPVALUE(User[Name],User[ID],Case[OwnerID])- AnonymousNot applicable
Sorry, I should have mentioned that I did try the Lookupvalue function - this was the error "The syntax for 'Case' is incorrect. (DAX(LOOKUPVALUE(User[Name],User[ID],Case[OwnerID]))). "
- AnonymousNot applicable
Doh! I realized my mistake. Forgot the ' around the table name.
CaseOwner = LOOKUPVALUE('User'[Name],'User'[Id],'Case'[OwnerId])