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
MEHUL123
Frequent Visitor

Create new table by combining 2 tables DAX (not in power query)

Hi,

 

I have 2 tables (non relationship tables)

I am trying to create 3rd separate table where i need to bring ALL available EMP IDs (TABLE 1) against each JOB NOs (table 2) having common CLUB IDs 

 

TABLE1 
CLUB IDEMP ID
ABC123
ABC456
ABC789
AAA001

 

 

TABLE2 
CLUB IDJOB NO
ABCXYZ
ABCLMN
ABCOPQ
AAAXXX
AAAYYY

 

 

 

TABLE3 - Desired Table  
CLUB IDJOB NOEMP ID
ABCXYZ123
ABCXYZ456
ABCXYZ789
ABCLMN123
ABCLMN456
ABCLMN789
ABCOPQ123
ABCOPQ456
ABCOPQ789
AAAXXX001
AAAYYY001

 

Pls help, thanks in advance

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @MEHUL123 ,

Please try to create a calculated table as below:

TABLE3 = 
SELECTCOLUMNS(
    FILTER(
        CROSSJOIN('TABLE1', 'TABLE2'),
        'TABLE1'[CLUB ID] = 'TABLE2'[CLUB ID]
    ),
    "CLUB ID", 'TABLE1'[CLUB ID],
    "JOB NO", 'TABLE2'[JOB NO],
    "EMP ID", 'TABLE1'[EMP ID]
)

vyiruanmsft_0-1729233662699.png

Best Regards

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

5 REPLIES 5
divyed
Super User
Super User

Hello @MEHUL123 ,

 

Here is the DAX for your reference.

 

T_3 =
VAR JoinedTable =
    FILTER(CROSSJOIN(T_1, T_2),T_1[CLUB_ID] = T_2[CLUB_ID])
RETURN

        SELECTCOLUMNS(
            JoinedTable,
            "CLUB_ID", T_1[CLUB_ID],
            "EMP_ID", T_1[EMP_ID],
            "JOB_NO", T_2[JOB_NO]
        )
       
divyed_0-1729237363436.png

 

If this helps, please mark this as solution. Appreciate Kudos always.

 

Cheers

Did I answer your question ? Mark this as solution if this helps, Kudos are appreciated.
Proud to be a super user!
v-yiruan-msft
Community Support
Community Support

Hi @MEHUL123 ,

Please try to create a calculated table as below:

TABLE3 = 
SELECTCOLUMNS(
    FILTER(
        CROSSJOIN('TABLE1', 'TABLE2'),
        'TABLE1'[CLUB ID] = 'TABLE2'[CLUB ID]
    ),
    "CLUB ID", 'TABLE1'[CLUB ID],
    "JOB NO", 'TABLE2'[JOB NO],
    "EMP ID", 'TABLE1'[EMP ID]
)

vyiruanmsft_0-1729233662699.png

Best Regards

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

Try this :

YourNeTable= 
FILTER(
    CROSSJOIN(Table1, Table2),
    TREATAS(Table1[CLUB ID], Table2[CLUB ID])
)

 



Regards,
Sachin
Check out my Blog

Hi, Thanks for response, however unable to create desired table, request your view on this.

Thanks in advance

Whats the error ?
Rename the column CLUB ID in either of the table from CLUB ID to CLUB_ID

NewTable = 
FILTER(
    CROSSJOIN(
        Table1,
        Table2
    ),
    Table1[CLUB ID] = Table2[CLUB_ID]
)

SachinNandanwar_0-1729193227274.png

 



Regards,
Sachin
Check out my Blog

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!

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.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.