Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello everyone!
I have 3 tables that are not related, and I need to get a combined query, I tried to use UNION and SELECTCOLUMNS, but it was not possible.
first table
fechaid_productid_facilityconsumoprograma
01-ene-22 | A | X | 10 | 5 |
02-ene-22 | A | X | 20 | 15 |
03-ene-22 | A | Y | 30 | 10 |
04-ene-22 | B | Y | 40 | 20 |
05-ene-22 | B | Z | 50 | 30 |
second table
fechaid_productid_facilityexistenciarecibido
01-ene-22 | A | X | 100 | 24 |
02-ene-22 | A | X | 200 | 56 |
03-ene-22 | A | Y | 300 | 76 |
04-ene-22 | B | Y | 400 | 45 |
05-ene-22 | B | Z | 500 | 56 |
third table
fechaid_facilityvolumen
01-ene-22 | X | 56 |
02-ene-22 | X | 43 |
03-ene-22 | Y | 45 |
04-ene-22 | Y | 65 |
05-ene-22 | Z | 21 |
expected result
fechaid_productid_facilityconsumoprogramaexistenciarecibidovolumen
01-ene-22 | A | X | 10 | 5 | 100 | 24 | 56 |
02-ene-22 | A | X | 20 | 15 | 200 | 56 | 43 |
03-ene-22 | A | Y | 30 | 10 | 300 | 76 | 45 |
04-ene-22 | B | Y | 40 | 20 | 400 | 45 | 65 |
05-ene-22 | B | Z | 50 | 30 | 500 | 56 | 21 |
any ideas, Thank you very much in advance.
PBIX-file: Query
Solved! Go to Solution.
Hi @Cipriano ,
You can use "Merge Queries as new" in Power Query and the expand the columns you need.
Final output:
Or you can try what @FreemanZ suggested to use TREATAS function which is best for use when a relationship does not exist between the tables.
You can reference the following document.
Merge queries overview - Power Query | Microsoft Learn
Virtual Relationship with TREATAS - Microsoft Power BI Community
Best Regards,
Community Support Team _ xiaosun
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Cipriano ,
You can use "Merge Queries as new" in Power Query and the expand the columns you need.
Final output:
Or you can try what @FreemanZ suggested to use TREATAS function which is best for use when a relationship does not exist between the tables.
You can reference the following document.
Merge queries overview - Power Query | Microsoft Learn
Virtual Relationship with TREATAS - Microsoft Power BI Community
Best Regards,
Community Support Team _ xiaosun
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
you can treat unrelated table columns as related ones with TREATAS function. https://dax.guide/treatas/
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
7 | |
7 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |