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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Merging two tables in powerquery that absolutely have nothing in common

Hi all,

I have one table that contains just one column with year and month:

 

Year And Month

2018-01

2018-02

2018-03

….

 

And I have one table with my customer ID’s

 

Customer ID

A1

B2

C3

….

 

I want to combine both tables together in one new table in Powerquery. End result should look like this:

 

Year And Month

Customer ID

2018-01

A1

2018-02

B2

2018-03

C3

2018-01

A1

2018-02

B2

2018-03

C3

2018-01

A1

2018-02

B2

2018-03

C3

 

How to do that?

1 ACCEPTED SOLUTION

Hi @Anonymous,

 

ok, then try following:

  1. Create an index column in the table YearAndMonth.
  2. Create an index column in the table CustomerId.
  3. Merge both tables via the new index column.
  4. Remove columns which you don't need.

I've created a PowerBI file containing all what I have described: PowerBI file

 

A screenshot of creating an index:

Capture1.PNG

And a screenshot of merging:

Capture.PNG

View solution in original post

4 REPLIES 4
Nolock
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

are you sure with the expected result? The three first lines repeat three times...

Anonymous
Not applicable

Hi @Nolock ,

Yes very sure about that. In Excel it's so easy to do, but i just don't know how to pull it off using PowerQuery.

 

Cheers

Bas

Hi @Anonymous,

 

ok, then try following:

  1. Create an index column in the table YearAndMonth.
  2. Create an index column in the table CustomerId.
  3. Merge both tables via the new index column.
  4. Remove columns which you don't need.

I've created a PowerBI file containing all what I have described: PowerBI file

 

A screenshot of creating an index:

Capture1.PNG

And a screenshot of merging:

Capture.PNG

Anonymous
Not applicable

Hi @Nolock ,

That's a brilliant workaround, I would have never thought about that.

Thanks so much for helping me with finding the right solution!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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