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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
dennis1994
Frequent Visitor

Combine two tables

Hello,

I would like to combine table 1 and table 2 from my photo, so that i end up like table 3. i dont quit get it. Can someone help me please?

1.png

 

Regards

Dennis

1 ACCEPTED SOLUTION

hi, @dennis1994 @acanepa

 

1. Import the data from TABLE1
2. Import the data from TABLE2
3. Edit the query in TABLE2 and remove the duplicates
4. Combine tables TABLE1 and TABLE2
5. Group the values (as pictured)

 

 

 

 

Clipboard01.gifClipboard02.gifClipboard03.gif

Clipboard03b.gifClipboard04.gif

Clipboard05.gif


Please try and test using it. And please mark the right answer as answer if your issue has been resolved, otherwise, please feel free to ask if you have any other issue.
 
Best Regards,
Rfranca

View solution in original post

5 REPLIES 5
acanepa
Resolver I
Resolver I

Hello @dennis1994,

 

You could use Crossjoin and filter to solve you issue.

 

I have created a sample workbook for replicating your data.

 

Table 3 is the example of what you want to achieve.

 

 

Table 1

 

table 1.png

 

Table 2

 

table 2.png

 

Table 3

table 3.png

 

 Code:

 

Table 3 = filter(
CROSSJOIN(Table1,Table2),[id]=[id2] && [Date] =[Date2])

 

I get the information from the following link:

https://www.sqlbi.com/articles/from-sql-to-dax-joining-tables/

 

Sample Workbook

https://ufile.io/rt1ae

 

Regards,

Hello acanepa,

 Thanks for the fast reply. Where exactly do i need to input the code? When i try to create a new table i get following error:

2.PNG

 

Ok i found my mistake.

The outcome is not completely how i would like to have it. What i get is a table with 7 rows:

image.png

What i want is a table with just 4 rows and the added column. As for several dates there are multiple rows in both tables, i get more rows then i want, what later falsifies my measures.

 

Another way i could think of is to "sum" table 1 something like:

If there are multiple values of column x for one date (e.g.: 09.01 has value 1 and value 0 -->two differnt rows) sum them so that there is just one row for that date

Something like this:

2.PNG

Hi @dennis1994

 

You need to change the column name "dri_exact_date" in one of the tables, the formula does not allow two columns with the same name.

 

You could use SELECTCOLUMNS for filtering columns.

 

Regards,

hi, @dennis1994 @acanepa

 

1. Import the data from TABLE1
2. Import the data from TABLE2
3. Edit the query in TABLE2 and remove the duplicates
4. Combine tables TABLE1 and TABLE2
5. Group the values (as pictured)

 

 

 

 

Clipboard01.gifClipboard02.gifClipboard03.gif

Clipboard03b.gifClipboard04.gif

Clipboard05.gif


Please try and test using it. And please mark the right answer as answer if your issue has been resolved, otherwise, please feel free to ask if you have any other issue.
 
Best Regards,
Rfranca

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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