Forum Discussion

Kishore_ak's avatar
Kishore_ak
Frequent Visitor
3 years ago
Solved

Search and get Multiple partial match results for each row using DAX

Hi

I am trying to search all partial matches for each value of one table from another table.  Can someone help me in te below.

Thank you.

 

 

 

  • Hi,

    I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

    It is for creating a new column in the Search table.

     

     

    Partial match IDs CC =
    CONCATENATEX (
        FILTER ( Source, CONTAINSSTRING ( Source[Name], 'Search'[Name] ) ),
        Source[ID],
        "; "
    )
    

     

     

  • Jihwan_Kim's avatar
    Jihwan_Kim
    3 years ago

    Hi,

    Thank you for your message.

    I do not know how your data model looks like, or how the relationship is created, but I assume there is no relationship between two table.

    Please check the below picture and the attahced pbix file.

     

     

    Partial match IDs CC = 
    CONCATENATEX (
        FILTER ( Source, CONTAINSSTRING ( Source[Name], 'Search'[Name] ) && Source[MID] = 'Search'[MID] ),
        Source[ID],
        "; "
    )

     

6 Replies

  • Hi,

    I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

    It is for creating a new column in the Search table.

     

     

    Partial match IDs CC =
    CONCATENATEX (
        FILTER ( Source, CONTAINSSTRING ( Source[Name], 'Search'[Name] ) ),
        Source[ID],
        "; "
    )
    

     

     

    • dmf's avatar
      dmf
      Frequent Visitor

      Hi I'm having a similar query but without the option for a seperate Search Table.

      Instead, I want to search the Source[ID] column against each value in the same column, Source[ID].

      Essentially I want to search the Source[ID] column for repeats and then paste the data from an adjacent column Source[Machine Number] for those matching rows in concatenated form.

      Thank you for any help!

      Original Table:

      IDRun1Run2Run3Machine Number
      YE144367711
      HJ351621712
      RT569012713
      HJ334545714
      BN5565278715
      YE1798990716
      HJ3232343717

       

      Table with New Column:

      IDRun1Run2Run3Machine NumberNew Column
      YE144367711716
      HJ351621712714,717
      RT569012713None
      HJ334545714712,717
      YE1798990716711
      HJ3232343717712,714
  • Kishore_ak's avatar
    Kishore_ak
    Frequent Visitor

    Hi Jihwan_Kim Is it possible to inlude an additional condition like below. 

    concatenation should happen only in case of their MIDs are matching. Thank you in advance. 

     

    • Jihwan_Kim's avatar
      Jihwan_Kim
      Icon for Super User rankSuper User

      Hi,

      Thank you for your message.

      I do not know how your data model looks like, or how the relationship is created, but I assume there is no relationship between two table.

      Please check the below picture and the attahced pbix file.

       

       

      Partial match IDs CC = 
      CONCATENATEX (
          FILTER ( Source, CONTAINSSTRING ( Source[Name], 'Search'[Name] ) && Source[MID] = 'Search'[MID] ),
          Source[ID],
          "; "
      )