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.
Hi Community,
I'm working with a table structured as follows:
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:
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:
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.
Solved! Go to Solution.
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
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.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
46 | |
26 | |
21 | |
12 | |
8 |
User | Count |
---|---|
75 | |
51 | |
45 | |
15 | |
12 |