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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
PBILover
Helper V
Helper V

Self Join in power Bi

Hi,

I have cosmos DB data where data is in different document formats. I want to use the column of the main document to connect another document from the same container in a power BI .

For e.g. 

one document has fields like id, Partition key, col1,col2 ....

another document has fields like id,partition Key,col1,col2 etc.

 

I want to have a separate table where the document1.partition key  = Document2.PartitionKey2

will it be possible?

this should be done in power query editor

Thank you

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @PBILover ,

 

Extract document1.partition key column as a table, and then create a function and invoke it. You can refer to this blog:

https://community.powerbi.com/t5/Community-Blog/Use-Column-as-Parameter-for-Custom-Function-in-Power... 

 

Best Regards,
Liang
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-lianl-msft
Community Support
Community Support

Hi @PBILover ,

 

Extract document1.partition key column as a table, and then create a function and invoke it. You can refer to this blog:

https://community.powerbi.com/t5/Community-Blog/Use-Column-as-Parameter-for-Custom-Function-in-Power... 

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@PBILover , if you want to create a hierarchy and use

https://radacad.com/parsing-organizational-hierarchy-or-chart-of-accounts-in-power-bi-with-parent-ch...

 

Other wise you have duplicate the tables and create join

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.