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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
iwf
Helper I
Helper I

Join two tables with different number of rows

Hi,

 

I need advise what technique use in DAX to solve this problem. I have to table that I need to join:

 

Table1

ID      NameUser  

1       John

1       David

2       John

2       David

2      George

 

 

Table2

ID    ClientName

1      XXX

1      YYY

1     ZZZ

2     XXX

2    YYY

 

The output table should be like this:

 

ID   NameUser     NameClient

1    John               XXX

1    David             YYY

1    (blank)         ZZZ

2     John            XXX

2     David          YYY

2     George        (blank)

 

The blank cells could alternatively contains one of the name from "above". That is for the UserName John or David; for the ClientName XXX or YYY

 

Thank you

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @iwf,

 

You should firstly add an index column inside group () in Query Editor mode.

 

Please refer to the attached .pbix file. The calculated table 'table_4' is the result table.

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
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

3 REPLIES 3
v-yulgu-msft
Employee
Employee

Hi @iwf,

 

You should firstly add an index column inside group () in Query Editor mode.

 

Please refer to the attached .pbix file. The calculated table 'table_4' is the result table.

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
zoloturu
Memorable Member
Memorable Member

Hi @iwf,

 

Here is a description of joins in DAX - https://www.sqlbi.com/articles/from-sql-to-dax-joining-tables/

 

Regards,
Ruslan
-------------------------------------------------------------------
Did I answer your question? Mark my post as a solution!

@zoloturu

 

Thank you for your answer. I saw that page earlier, but I am afraid, that I need to push little bit more. I know, that  I cannot use any "naturaljoin".

The example with the EVALUATION, it needs to be done via the DAX studio?

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.