Forum Discussion

AsaThor's avatar
AsaThor
New Member
1 year ago
Solved

Concatenate values based on new and old value

Hi there,  I could need you help.  I got a table that is looking like this: IssueId AUTHOR CREATED FIELD OLDVALUE NEWVALUE pkey 3370181 [email protected] 2023-02-09 14:30:47...
  • rajendraongole1's avatar
    1 year ago

    Hi AsaThor  - i have created a calculated column as below:

     

    Please check

     

     

    you can replace table name as per your model. 

     

    Correct =
    VAR CurrentPKey = 'concc'[pkey]
    VAR CurrentCreated = 'concc'[CREATED]
    VAR AllRows =
        FILTER(
            'concc',
            'concc'[pkey] = CurrentPKey &&
            'concc'[CREATED] <= CurrentCreated
        )
    VAR Additions =
        DISTINCT(
            SELECTCOLUMNS(
                FILTER(AllRows, 'concc'[FIELD] = "Fix Version" && NOT(ISBLANK('concc'[NEWVALUE]))),
                "Version", 'concc'[NEWVALUE]
            )
        )
    VAR Removals =
        DISTINCT(
            SELECTCOLUMNS(
                FILTER(AllRows, 'concc'[FIELD] = "Fix Version" && NOT(ISBLANK('concc'[OLDVALUE]))),
                "Version", 'concc'[OLDVALUE]
            )
        )
    VAR ActiveVersions =
        EXCEPT(Additions, Removals)
    RETURN
        CONCATENATEX(ActiveVersions, [Version], ", ")