cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Anonymous
Not applicable

I neet to create a table from two tables

Hi all!

I need to create a new table from two existing tables.

First table ('Orders')

I have a summarized table with delivery date, store number and orders (for each store and date)

sebonidas_0-1635196719418.png

 

Second table ('Claims')

I have a summarized table with store (N Local), Date of claim (Fecha de creación) and claims (for each store and date)

Claims.PNG

I need to create a new table with structure (date, store, orders, claims) for each store and each date..

For example for 2997 store, and date 25/10/2011 we have 81 orders and only 1 claim

 

Pls your comments

Thanks!

SM.-

 

1 ACCEPTED SOLUTION
v-robertq-msft
Community Support
Community Support

Hi, @Anonymous 

According to your description, I think you can use the “Merge query” in the Power query to left join the two tables with two external keys, you can follow my steps:

  1. Go to the Power query and merge a new query:

vrobertqmsft_0-1635757024801.png

 

  1. Set the merge query like this:

vrobertqmsft_1-1635757024804.png

  1. Then you can get the output table like this:

vrobertqmsft_2-1635757024806.png

 

You can download my test pbix file below

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-robertq-msft
Community Support
Community Support

Hi, @Anonymous 

According to your description, I think you can use the “Merge query” in the Power query to left join the two tables with two external keys, you can follow my steps:

  1. Go to the Power query and merge a new query:

vrobertqmsft_0-1635757024801.png

 

  1. Set the merge query like this:

vrobertqmsft_1-1635757024804.png

  1. Then you can get the output table like this:

vrobertqmsft_2-1635757024806.png

 

You can download my test pbix file below

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello @Anonymous,

 

There is two ways.

 

First: you can add it as regular calculated column. So select table --> New column --> Name it and imput the formula.

StenbergAleksi_1-1635244533362.png

 

Second you can add it to your DAX:
Just like this for example.

StenbergAleksi_2-1635244602467.png

Hope this helps!

Hello Sebonidas,

 

If you really want to create a new table you could create calculated table with naturalinnerjoin function or use summarizecolumns if the tables have relationship.

 

But if you just need to mix the data you could just use lookup function to add a new calculated column for either table.

 

You can add this to orders table:

lookupvalue('Claims'[Claims],'Claims'[N° local],'Order'[Store_nbr]

Hope this helps.

 

If this solved the issue, please mark the comment as solved

Anonymous
Not applicable

thanks @StenbergAleksi  but i have created the order table like this.

 
Orders = SUMMARIZE(Order_Cabecera, Order_Cabecera[FechaEntrega].[Date],Order_Cabecera[Store_nbr], "Orders", COUNT(Order_Cabecera[CodigoPedido]))
 
How can i add the LOOKUP??
 
Thanks a Lot!
SM.-

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors