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
swe_sebastian
Regular Visitor

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

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
Mariusz
Community Champion
Community Champion

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

 

 

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

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

 

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.