Forum Discussion

Tasos's avatar
Tasos
Helper II
8 years ago
Solved

Summarising table based on multiple values

 Hello,   I am looking for something that can be either quite easy or extremely difficult.   I have a table like the following one where different lines may have the same ID and same or different...
  • MarcoRotta's avatar
    MarcoRotta
    8 years ago

    Hi there.

     

    In the example below I'm using your original data table layout (as in your picture) but named as "Data" in my model:

     

     

     

     

     

     

     

     

     

     

    To create a summarized table using DAX, just go to "Modeling > New Table" and type:

     

    New Table = values(Data[orders])

     

    This creates a new table with the unique values of orders. You can change "New Table" above to whatever name you like for the table, of course.

     

    Now you can go to "Modeling > New Column" and add a DAX expression to concatenate the different values in different rows for each order, which is:

     

    ConcatenatedValues = CONCATENATEX(FILTER(Data,Data[orders]='New Table'[orders]),Data[department]," | ")

     

    In the expression above, the last parameter is the separator you want. I've used "|", but it could be you "&" or anything else.  

     

    Final result:

     

     

     

     

     

     

     

     

     

    Hope it helps.