cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Create new table with information from two other tables

I need to create a new table and merge two other tables into this one.

One table contains invoiced information and the other table has current order information.

 

There are some columns that should be merged into the same column as "Customer name", "Item id", "Description" and so on but there are also different information that must go in seperate colums as "Sold qty", Invoiced qty" and so on.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User IV
Super User IV

Re: Create new table with information from two other tables

Hi @swe_sebastian 

 

You can create your customer table using DAX expression, as an example below.

Customers = 
DISTINCT(
    UNION(
        ALLNOBLANKROW( orders[CustomerKey], orders[Name] ),
        ALLNOBLANKROW( invoices[CustomerKey], invoices[Name] )
    )
)

 Or use Power Query 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

View solution in original post

3 REPLIES 3
Highlighted
Super User IV
Super User IV

Re: Create new table with information from two other tables

Hi @swe_sebastian 

 

Are you sure, that you want to merge these tables?

There could be a situation where you have two or more invoices per order and vice versa, this situation would potentially create duplicate values.

 

Would it not be easier to keep these tables separate and create dimension tables ( customers, Items ) with relationships to both Invoice and order tables

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

 

Highlighted
New Member

Re: Create new table with information from two other tables

Hi @Mariusz 

 

That is one way to do it.

 

Unfortunately I don't have a table with customer id.

There might be situations where I have customers with open orders and no invoices so they will not be in the invoice table.

 

I would like to be able to have a matrix with invoiced & current orders for the customer and also be able to look into each product.

 

/Sebastian

Highlighted
Super User IV
Super User IV

Re: Create new table with information from two other tables

Hi @swe_sebastian 

 

You can create your customer table using DAX expression, as an example below.

Customers = 
DISTINCT(
    UNION(
        ALLNOBLANKROW( orders[CustomerKey], orders[Name] ),
        ALLNOBLANKROW( invoices[CustomerKey], invoices[Name] )
    )
)

 Or use Power Query 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

View solution in original post

Helpful resources

Announcements
May 2020 Community Highlights

May 2020 Community Highlights

It’s time for another PBI Community recap!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Galleries

Galleries

Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries!

Top Solution Authors