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.
this is sample table:
I have four different tables:
City ID 2015
Jaipur | 4 |
tripura | 5 |
Frankfurt | 7 |
City ID 2016
Jaipur | 5 |
tripura | 6 |
berlin | 7 |
City ID 2017
Jaipur | 7 |
grt | 4 |
raipur | 7 |
City ID 2018
Bremen | 5 |
Leipzig | 7 |
Freiberg | 9 |
I have to merge and create a single table like this :
City ID 2015 ID 2016 ID 2017 ID 2018
Newyork | 4 | 5 | 7 | |
Tokyo | 5 | 6 | 7 | |
Frankfurt | 7 | |||
Berlin | 7 | |||
Milan | 4 | |||
Bremen | 5 | |||
Leipzig | 7 | |||
Dresden | 9 |
Solved! Go to Solution.
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
It is for creating a new table.
New Table =
ADDCOLUMNS (
SUMMARIZE ( UNION ( Table1, Table2, Table3, Table4 ), [City] ),
"@2015", CALCULATE ( SUM ( Table1[2015] ), Table1[City] = EARLIER ( [City] ) ),
"@2016", CALCULATE ( SUM ( Table2[2016] ), Table2[City] = EARLIER ( [City] ) ),
"@2017", CALCULATE ( SUM ( Table3[2017] ), Table3[City] = EARLIER ( [City] ) ),
"@2018", CALCULATE ( SUM ( Table4[2018] ), Table4[City] = EARLIER ( [City] ) )
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
It is for creating a new table.
New Table =
ADDCOLUMNS (
SUMMARIZE ( UNION ( Table1, Table2, Table3, Table4 ), [City] ),
"@2015", CALCULATE ( SUM ( Table1[2015] ), Table1[City] = EARLIER ( [City] ) ),
"@2016", CALCULATE ( SUM ( Table2[2016] ), Table2[City] = EARLIER ( [City] ) ),
"@2017", CALCULATE ( SUM ( Table3[2017] ), Table3[City] = EARLIER ( [City] ) ),
"@2018", CALCULATE ( SUM ( Table4[2018] ), Table4[City] = EARLIER ( [City] ) )
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
First combine two tables after that then combine the merged tables hope this worked
Did I answer your question? If so, please mark my post as a solution!
Proud to be a Super User!
https://radacad.com/append-vs-merge-in-power-bi-and-power-query
Did I answer your question? If so, please mark my post as a solution!
Proud to be a Super User!
Thanks for reply.
But in merge queries, i can combine only two tables.
How to combine multiple tables?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
98 | |
77 | |
66 | |
53 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |