Forum Discussion

Ashish_Mathur's avatar
Ashish_Mathur
Icon for Super User rankSuper User
2 years ago
Solved

Concatenate via a calculated column formula

Hi, In the image below, the first 2 columns are the input columns and the third one is the expected result.  In each row of the table, for the fruit in the current row, i wish to concatenate all th...
  • DataInsights's avatar
    2 years ago

    Ashish_Mathur,

     

    Try this calculated column:

     

    Unique Calorie =
    VAR vFruit = Table1[Fruit]
    VAR vTable =
        CALCULATETABLE (
            VALUES ( Table1[Calorie] ),
            Table1[Fruit] = vFruit,
            ALL ( Table1 )
        )
    VAR vResult =
        CONCATENATEX ( vTable, Table1[Calorie], ", " )
    RETURN
        vResult