Forum Discussion

sipati's avatar
sipati
Microsoft Employee
6 years ago
Solved

Add alternating data in new column

I have table like this:

IDDate
112/01/2019
214/01/2019
215/01/2019
316/01/2019
317/01/2019

 

I want it to be like this:

IDDateStatus
112/01/2019Unresolved
214/01/2019Unresolved
215/01/2019Resolved
316/01/2019Unresolved
317/01/2019Resolved

 

So basically in the alternating format ,I want to add the third column with values: Unresolved, Resolved.

So if a ID occurs first time, it should be "Unresolved", if it is found again then "Resolved".

  • Hi sipati ,

    Please try the calculated column below.

    new column =
    VAR index =
        RANKX (
            FILTER ( 'Table', 'Table'[ID] = EARLIER ( 'Table'[ID] ) ),
            'Table'[Date],
            ,
            ASC
        )
    RETURN
        IF ( index = 1, "Unsloved", "Resolved" )
    

    Here is the output.

    Best Regards,

    Cherry

4 Replies