Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sipati
Employee
Employee

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".

1 ACCEPTED SOLUTION

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.

Capture.PNG

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4

Sorry, I am new. If possible, can you share a proper DAX or M query? Thanks.

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.

Capture.PNG

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

try something like this

CALCULATE(MAX(Table[Date]),FILTER(Data,Table[ID]=EARLIER(Table[ID])&&Table[Date]<EARLIER(Table[Date])))

and use the output to build case statement 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.