cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GCGradwell Regular Visitor
Regular Visitor

Concatenate data into new column using heirarchies

Hi,

 

I am trying to create a new column which concatenates data from two different columns. These columns are in different tables and are linked to each other by relationships within Power BI.

 

I want to concatenate Customer ID and Department. Customer ID is in the same table as product. Products are categorized by product class and each product class is a member of a department.

 

Thread 3 img 2.png

 

 

 

 

Many thanks,

 

Greg

1 ACCEPTED SOLUTION

Accepted Solutions
chrisu Member
Member

Re: Concatenate data into new column using heirarchies

As stated above, you'd need a calculated column.  In my own data with a similar setup (pulling the "one" side to a "many" side of a relationship two tables away), I was able to do this using a single formula that looks like this:

 

IDDepartment = CONCATENATE(Invoices[Customer ID], RELATED('Product Class'[Department]))

 

 

3 REPLIES 3
ankitpatira Super Contributor
Super Contributor

Re: Concatenate data into new column using heirarchies

@GCGradwell i think you need to make use of dax calculated columns. so first make use of lookupvalue function to create a calculated column in product details table that contains department name. then use related() function of dax to create calculated column in Invoices table that contains department name. then simply use concatenate() function for customer id and department in invoices table.

chrisu Member
Member

Re: Concatenate data into new column using heirarchies

As stated above, you'd need a calculated column.  In my own data with a similar setup (pulling the "one" side to a "many" side of a relationship two tables away), I was able to do this using a single formula that looks like this:

 

IDDepartment = CONCATENATE(Invoices[Customer ID], RELATED('Product Class'[Department]))

 

 

GCGradwell Regular Visitor
Regular Visitor

Re: Concatenate data into new column using heirarchies

Fantastic! Excellent solution, I really appreciate the help.

 

Massive thanks!

 

Greg

Helpful resources

Announcements
Community Highlights

Community Highlights

Find out what's new in the Power BI Community!

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 175 members 1,939 guests
Please welcome our newest community members: