The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I'm looking to combine data from two columns from different tables. Not merge. Each table has two columns country and event and I want to create a new table that contains both tables as shown below. I know I can do this by Append Query as New in Power Query. However, this slows the model a lot. I have shown only two columns of each tables whereas in reality there are more than 30-40 columns and 1000s of rows in each table. So append queries and delete the remaining columns is very tedious and slwos the data refresh. Is there any way I can pull only these two columns from the two tables directly and create a combined new table witout losing the relation between Country and Ticket? Model here....
Thanks in advance,
-AM
Solved! Go to Solution.
hi @amani1980 ,
try to write a calculated table like:
table3=
DISTINCT(
UNION(
SUMMARIZE(
table1,
table1[country],
table1[ticket]
),
SUMMARIZE(
table2,
table2[country],
table2[ticket]
)
)
)
hi @amani1980 ,
try to write a calculated table like:
table3=
DISTINCT(
UNION(
SUMMARIZE(
table1,
table1[country],
table1[ticket]
),
SUMMARIZE(
table2,
table2[country],
table2[ticket]
)
)
)
Hi,
Thanks for replying!
I want to do something similar not quite the same - I don't want to combine all columns from both tables. Just the Country and Ticket columns from the 30-40 colunms there is in each one of the tables. I showed just the two columns in the screenshot for sake of simplicity.
hello @amani1980
i might be misunderstood but perhaps what you are looking for is UNION().
here is a simple example:
- Table 1
- Table 2
- New Table with UNION() DAX
Hope this will help.
Thank you.
User | Count |
---|---|
27 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
31 | |
15 | |
12 | |
7 | |
6 |