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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Creating Column in Table View Combining Two Tables with same ids but one with duplicates

I have two tables as depicted in the visuals here. As you can see table 2 has a mix of blanks and additional entries. I need table A exactly as is but with the blanks removed and additional entries from table 2 for the same id separated by commas as shown.

Preferably via DAX.

 

TIA

Needed table

1IA,XU
2PG,GTM
3XU
4XU
5GTM,IA

Table 1

1IA
2PG
3XU
4XU
5GTM

 

Table 2

 XU
 PG
1IA
1XU
2PG
2GTM
3XU
4XU
5GTM
5IA
3 REPLIES 3
DimaMD
Solution Sage
Solution Sage

@Anonymous  Hi try it 2 calculate table

CombinedTable = 
FILTER (
    UNION (
        SELECTCOLUMNS ( 'Table 1', "ID", 'Table 1'[Col1], "Value", 'Table 1'[Col2] ),
        SELECTCOLUMNS ( 'Table 2', "ID", 'Table 2'[Col1], "Value", 'Table 2'[Col2] )
    ),
    NOT ISBLANK ( [ID] )
)

and

NeededTable =
SUMMARIZE (
    CombinedTable,
    CombinedTable[ID],
    "CombinedValues", CONCATENATEX (
        VALUES ( CombinedTable[Value] ),
        CombinedTable[Value],
        ","
    )
)

__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: [email protected]
Anonymous
Not applicable

Thanks for the reply. For the 1st one i get an error. The expression refers to muliple columns. Multiple columns cannot be converted to a scalar value

@Anonymous Hi, Show your DAX code


__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: [email protected]

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.