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

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_NumberOwnerID
22234QRF24B34OP
22235QRF24B956T
22236QRF24BBF21
22237QRF24BP09J
  
"User" 
IDName
QRF24B34OPEric
QRF24B956TMary
QRF24BBF21Nassif
QRF24BP09JVu
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Doh!  I realized my mistake.  Forgot the ' around the table name.

 

CaseOwner = LOOKUPVALUE('User'[Name],'User'[Id],'Case'[OwnerId])

View solution in original post

3 REPLIES 3
ArunkumarK
Helper I
Helper 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])
Anonymous
Not applicable

Doh!  I realized my mistake.  Forgot the ' around the table name.

 

CaseOwner = LOOKUPVALUE('User'[Name],'User'[Id],'Case'[OwnerId])
Anonymous
Not 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]))). "

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.