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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Create change column based on value & ranked column

Hi

 

I am trying to recreate the table below, I have already created a Rank column linked to User ID & now need to create the change column indicating if the Bonus column has increased or decreased for each employee: 

 

RankUser IDBonusChange
1123458 
25432110 
25432112Increase
25432113Increase
3124686 
31246810Increase
3124688Decrease

 

Thanks,

Katie

8 REPLIES 8
parry2k
Super User
Super User

@Anonymous one column seems to be missing from table is how to order under each id which value should come first, is there any date column that tells the when that bonus happened.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Hi Parry, 

 

Thanks for the quick response - yes I do have an 'Event Date' field that can be used

@Anonymous yes that would be required, can you repost your data example with event date column



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Hi Perry, I've updated the data with the event date:

 

I should have mentioned that there will be rows with the same bonus value for the same User ID but a different event date - for these the status field should be blank like the below: 

 

RankUser IDEvent DateBonusChange
11234501/01/20198 
11234531/01/20198 
11234501/02/20198 
11234501/05/20199Increase
11234501/08/20199 
11234501/10/20199 
25432101/02/201910 
25432101/03/201910 
25432101/05/201910 
25432101/08/201912Increase
25432101/12/201913Increase
31246801/05/20196 
31246801/08/201910Increase
31246801/10/20198Decrease
31246801/12/20198 
31246801/01/20208 
Anonymous
Not applicable

Hi @Anonymous,

Can you please share a sample pbix file for test? It seems like your table contains duplicate records so that it return multiple records that can't be compared with normal operators.

Notice: remove or do mask on sensitvie data.

Regards,

Xiaoxin Sheng

Anonymous
Not applicable

Hi Parry, 

 

Sure no problem - please see the below sample data:

 

RankUser IDEvent DateBonusChange
11234501/01/20198 
25432101/02/201910 
25432101/08/201912Increase
25432101/12/201913Increase
31246801/05/20196 
31246801/08/201910Increase
31246801/10/20198Decrease

 

Anonymous
Not applicable

HI @Anonymous,

You can try to use below calculate column formula if it meets for your requirement:

 

Status =
VAR prevDate =
    CALCULATE (
        MAX ( Table[Event Date] ),
        FILTER (
            ALLSELECTED ( Table ),
            [Rank] = EARLIER ( Table[Rank] )
                && [Event Date] < EARLIER ( Table[Event Date] )
        )
    )
VAR prevBonus =
    LOOKUPVALUE (
        Table[Bonus],
        Table[Rank], [Rank],
        Table[Event Date], prevDate
    )
VAR diff = [Bonus] - prevBonus
RETURN
    IF (
        prevDate <> BLANK (),
        IF ( diff > 0, "Increase", IF ( diff < 0, "Decrease" ) )
    )

 

Regards,

Xiaoxin Sheng

Anonymous
Not applicable

Thanks for the reply, I am getting the error "A table of multiple values was supplied where a single value was expected.", I tried replacing the MAX with FIRSTNONBLANK & VALUES and each of these functions are returning results but they are not correct i.e the increase, decrease are not labelling accurately.

 

I should have mentioned that there will be rows with the same bonus value for the same User ID but a different event date - for these the status field should be blank like the below: 

 

RankUser IDEvent DateBonusChange
11234501/01/20198 
11234531/01/20198 
11234501/02/20198 
11234501/05/20199Increase
11234501/08/20199 
11234501/10/20199 
25432101/02/201910 
25432101/03/201910 
25432101/05/201910 
25432101/08/201912Increase
25432101/12/201913Increase
31246801/05/20196 
31246801/08/201910Increase
31246801/10/20198Decrease
31246801/12/20198 
31246801/01/20208 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.