Forum Discussion

ranis1227's avatar
ranis1227
Icon for Helper I rankHelper I
4 years ago
Solved

DAX to Concatenate Correspond Rows?

Hello,   I am trying to concatenate 2 correspond rows  in the same column.   Here is my example:   I need Malignant neoplasm associated with transplanted organ on the same row to C802.    ...
  • Syk's avatar
    4 years ago

    Right click your first column and fill down


    This will give your descriptions the same ID.

    Then right click the same row and select group by and set it to MAX of the description

    and you should get something like this

    Replace the highlighted text 'List.Max' with 'Text.Combine' (also throw a space in there to seperate the strings) and you get....

    changes are highlighted

     

  • Jihwan_Kim's avatar
    4 years ago

    Hi,

    I am not sure if I understood your question correctly, but if you can go into Power Query Editor, try using FILLDOWN function in order to make null value same as the above value.

    https://docs.microsoft.com/en-us/power-query/fill-values-column

     

    And then try creating a new table by writing a DAX formula something like below.

     

    Please check the below picture and the attached pbix file.

     

     

     

     

    New Table =
    ADDCOLUMNS (
        VALUES ( Data[Column1] ),
        "@NewColumn", CALCULATE ( CONCATENATEX ( Data, Data[Column2], " " ) )
    )