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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
tebtim19
Helper IV
Helper IV

Merging Data

Hi can anyone help me with merging data

 

I have 2 table which I neeed to merge, but I dont have any relationship to this table

 

the reason why I need to merge is, I want to combined the values from 2 different tables

 

table 1

 

Type   Average

A         15

B         11

C         10

D         9

 

table 2

TypeCategory  Avg

E                       15

F                        16

G.                       9

H.                       5

 

so this should results of

 

Category    Avg

A.                15

B.                11

C.                10
D.                9

E.                15
F.                 16

G.                 9

H.                5

 

 

 

4 REPLIES 4
PijushRoy
Super User
Super User

Hi @tebtim19 

Go to Power Query
In table1 and rename the column, "Type" as "Categoty" and "Average" as "AVG"
In table2 and rename the column, "TypeCategory" as "Categoty"

Go to Append or Append as New and marge the data
0.JPG

 

If solve your requirement, please mark this answer as SOLUTION
If this comment helps you, please LIKE this comment/Kudos

tackytechtom
Super User
Super User

Hio @tebtim19 ,

 

I think you a few options here. 

 

One way would be to rename the columns for one of the tables and then use the Append Queries function in Power Query:

tomfox_2-1649183291636.png

 

 

 

Another way would be to use the UNION function in DAX:

tomfox_1-1649183196103.png

 

Here the code:

NewTable2 = UNION (Table1, Table2)

 

Does this help? 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/

 



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

How about if one of the column is have more data than the other column. For example?

 

table 1

 

Type   Average

A         15

B         11

C         10

D         9

 

table 2

TypeCategory  Avg

E                       15

F                        16

G.                       9

H.                       5

I                         1

J                         2

 

so this should results of

 

Category    Avg

A.                15

B.                11

C.                10
D.                9

E.                15
F.                 16

G.                 9

H.                5

I                   1

J                   2

HI @tebtim19 

For example , If you have 4 rows in one table1 and 150 rows in another table2.
Append in Power Query 
and Union in Power BI Desktop will both works

It is not depends on the ROWS number in both table, The column name should be same when you going to append two or more tables.

 

Go to Power Query
In table1 and rename the column, "Type" as "Categoty" and "Average" as "AVG"
In table2 and rename the column, "TypeCategory" as "Categoty"

Go to Append or Append as New and marge the data

 

Hope this notes helps you

 

If solve your requirement, please mark this answer as SOLUTION
If this comment helps you, please LIKE this comment/Kudos

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.