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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Cipriano
Helper III
Helper III

Query based on tables without relations?

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-22AX105
02-ene-22AX2015
03-ene-22AY3010
04-ene-22BY4020
05-ene-22BZ5030

 

second table

fechaid_productid_facilityexistenciarecibido

01-ene-22AX10024
02-ene-22AX20056
03-ene-22AY30076
04-ene-22BY40045
05-ene-22BZ50056

 

third table

fechaid_facilityvolumen

01-ene-22X56
02-ene-22X43
03-ene-22Y45
04-ene-22Y65
05-ene-22Z21

 

expected result

 

fechaid_productid_facilityconsumoprogramaexistenciarecibidovolumen

01-ene-22AX1051002456
02-ene-22AX20152005643
03-ene-22AY30103007645
04-ene-22BY40204004565
05-ene-22BZ50305005621

 

any ideas, Thank you very much in advance.

 

PBIX-file: Query 

 

1 ACCEPTED SOLUTION
v-xiaosun-msft
Community Support
Community Support

Hi @Cipriano ,

 

You can use "Merge Queries as new" in Power Query and the expand the columns you need.

vxiaosunmsft_0-1669357693644.pngvxiaosunmsft_1-1669357734458.png

Final output:

vxiaosunmsft_2-1669357770495.png

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.

View solution in original post

2 REPLIES 2
v-xiaosun-msft
Community Support
Community Support

Hi @Cipriano ,

 

You can use "Merge Queries as new" in Power Query and the expand the columns you need.

vxiaosunmsft_0-1669357693644.pngvxiaosunmsft_1-1669357734458.png

Final output:

vxiaosunmsft_2-1669357770495.png

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.

FreemanZ
Super User
Super User

you can treat unrelated table columns as related ones with TREATAS function. https://dax.guide/treatas/

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.