Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Replace Values from Different tables

Hey Guys,

 

I need help with this query in M-code.

I have one table which has general data and is quite big and slow (Table1). I also have another table which has newer data, fast and shiny (Table2). I need a new table "Table3" which has all values and colums of Table1, but everytime Table2 and Table1 have the same column name, I need the "newer" value from Table 2.
Also, I need all columns from both Table1 and Table2

 

It should look like this:

JanikSchaefer_0-1655966687728.png

 

 

Is there a fast way to do this


Thanks for your help, really appreciate it. 3 tables below.

 

Greetings,

Janik





Table1

IdentNoValue1Value2Value3Value21Value30
119689204515151006
259182754195716629
378421006129571
4503846629662984
5739409571957140
68675855723523
7523846334125125768
876892386023956
99565785423235

 Table 2

IdentNoValue1Value3Value21Value_New1
273912335123
4210068443433
5842321512152
64095712312

52422

Table3(Goal)

IdentNoValue1Value2Value3Value21Value30Value_New1
119689204515151006 
273982123356629123
378421006129571 
42841006848443433
58440232151240152
640589571231252352422
7523846334125125768 
876892386023956 
99565785423235 
3 REPLIES 3
NickolajJessen
Solution Sage
Solution Sage

Fun challange

Good job for including table format data in your post!! 

https://drive.google.com/drive/folders/1AjePk7NUXAloXHr42BEa2lDOr5dQr2Wg

Anonymous
Not applicable

Thanks for your answers.

I need a solution directly in M with a query in the end as I do this in Power BI Dataflows and need a data table like Table3.

Any suggestions in M?

Thanks! 🙂

Just pivot table2 it back to original format 🙂

Add this to the last step on table 2:

 

= Table.Pivot(#"Removed Columns", List.Distinct(#"Removed Columns"[Attribute]), "Attribute", "Value")

 

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors