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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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