Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Return a concatenated string value based on calculation

Greetings everyone! I need help with the following moment:   There are 2 columns: 1) Say the first column is a name of product  2) Second column is a part that belongs to a...
  • tamerj1's avatar
    4 years ago

    Anonymous 
    Please try

    =
    VAR CurrentProject =
        SELECTEDVALUE ( TableName[Name] )
    VAR CurrentPartTable =
        CALCULATETABLE ( TableName, ALLEXCEPT ( TableName, TableName[Part #] ) )
    RETURN
        IF (
            COUNTROWS ( CurrentPartTable ) = 1,
            CurrentProject,
            CONCATENATEX ( CurrentPartTable, TableName[Name], ", ", TableName[Name], ASC )
        )