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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
ruanctorres
Frequent Visitor

Joining tables without primary key

Hi everybody,

 

Im trying to join tables with no primary keys. Is it possible?

 

For example:

 

Table 1:

table1.JPG

 

Table 2:

table2.JPG

 

 

A need a table result where for each day I have all the rows of the table 2. I tried merging, but the result was this:

 

table3.JPG

 

Thanks for helping.

 

 

 

 

 

1 ACCEPTED SOLUTION

Hi Lydia,

 

Thanks for your time. In fact, I solved this problem creating a column in both tables, filling the rows with the same result, for example "1".

 

Best regards.

View solution in original post

3 REPLIES 3
dwscottjr
New Member

If I have 2 queries and I want to join them without a key, I make a custom column in the first query that is the second query:

 

= Table.AddColumn(Source, "From Table 2", each #"Table2")

v-yuezhe-msft
Employee
Employee

@ruanctorres,

Are there matching rows between the two tables? If not, it will return null result when you use "Merge Queries", please create new table using the DAX below and check if you get expected result. If you have matching rows between two tables, expand the new column after you use "Merge Queries", you can review this blog to get more details.

Table  = CROSSJOIN(Table1,Table2)


Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Lydia,

 

Thanks for your time. In fact, I solved this problem creating a column in both tables, filling the rows with the same result, for example "1".

 

Best regards.

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.