Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

csv value filter

Hi All,

 

I have ID and Name column in two different tables

ID is comma separated value.

Table 1
ID
1,2,3
2,4
5,2

 

Table 2 
IDName
1A
2B
3C
4D
5E

I want to get Name column as comma separated as ID. The output should be :

 

Table 3 
IDName
1,2,3A,B,C
2,4B,D
5,2E,B

 

TIA

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Anonymous ,

     

    You could create a column using the following formula:

    Name =
    CONCATENATEX (
        CALCULATETABLE (
            VALUES ( Table2[Name] ),
            FILTER ( Table2, SEARCH ( Table2[ID], Table1[ID], 1, 0 ) > 0 )
        ),
        [Name],
        ","
    )

    Did I answer your question ? Please mark my reply as solution. Thank you very much.

    If not, please upload some insensitive data samples and expected output.

     

    Best Regards,

    Eyelyn Qin

     

3 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hey Amit.. Thanks for the solution but i want to achieve it withing DAX.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    You could create a column using the following formula:

    Name =
    CONCATENATEX (
        CALCULATETABLE (
            VALUES ( Table2[Name] ),
            FILTER ( Table2, SEARCH ( Table2[ID], Table1[ID], 1, 0 ) > 0 )
        ),
        [Name],
        ","
    )

    Did I answer your question ? Please mark my reply as solution. Thank you very much.

    If not, please upload some insensitive data samples and expected output.

     

    Best Regards,

    Eyelyn Qin