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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
marcofalzone
Helper I
Helper I

DAX Measure to concatenate common values found in more columns

Hi Community,

I'm working with a table structured as follows:

marcofalzone_1-1688788447554.png

I would like to write a DAX measure that returns in any row a unique string of combination of Column_1 and Column_2 values that belongs to both columns.

 

For example, if I put a slicer selector on Blue, the visual should return the following:

marcofalzone_2-1688788606040.png

Values "200" and "450" are not part of the concatenation because they only appear on Column_2.

And, if I turn the slicer on Yellow, it shall return:

marcofalzone_3-1688788711477.png

Again, values "200" and "450" in Column_2 do not become part of the Concatenation, since are not common to both columns.

In other words, I'm trying to figure out how to write a measure that repeat the same combination in any row of the row context [regardless the row] and is filtered by the field context based on Column_3.

 

I do appreciate your kind suggestions!

Marco.

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @marcofalzone,

I'd like to suggest you use INTERSECT and CONCATENATEX functions to get the intersect part of values from two columns.

formula =
CONCATENATEX (
    INTERSECT ( VALUES ( Table1[column1] ), VALUES ( Table1[column2] ) ),
    [column1],
    ", "
)

Regards,

Xiaoxin Sheng

View solution in original post

2 REPLIES 2
marcofalzone
Helper I
Helper I

Hi Xiaoxin, the proposed formula is perfect, thank you for the time dedicated to my question.

I have a couple of question for you, just for my growth in DAX language:

 

Is there any way to convert the ouput of your formula in order to return a table as output? It could be useful to use that output as input "IN" syntax (argument of "CALCULATE"), which requires a table as well.

 

Thank you.

Anonymous
Not applicable

Hi @marcofalzone,

I'd like to suggest you use INTERSECT and CONCATENATEX functions to get the intersect part of values from two columns.

formula =
CONCATENATEX (
    INTERSECT ( VALUES ( Table1[column1] ), VALUES ( Table1[column2] ) ),
    [column1],
    ", "
)

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.