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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Manjarigoyal1
Frequent Visitor

Compare, Replace values based on Condition

I have this table  shown below. I want to group by Site and if SFID is blank for Status Active and SFID is populated for Deselect then the values of SFID, task and Workflow needs to move from row 3 to row 2.

 

Original Data 

SnoSiteStatusSFIDTypeTaskWorkFlow
1Site AnullnullSwift  
2Site AActivenullSwift  
3Site ADeselect2929194Retain2INSTALL
4Site BnullnullSwift  
5Site BActivenullSwift  
6Site BDeselect2928855Retain2INSTALL
7Site CActive1234567Retain2INSTALL
8Site DActive1235668Swift2INSTALL
9Site DDeselect1235639Retain2DAS
10Site DActive1278537BH2GUP

 

Result should look like this as below

SnoSiteStatusSFIDTypeTaskWorkFlow
1Site AnullnullSwift  
2Site AActive2929194Swift2INSTALL
3Site ADeselectnullRetain  
4Site BnullnullSwift  
5Site BActive2928855Swift2INSTALL
6Site BDeselectnullRetain  
7Site CActive1234567Retain2INSTALL
8Site DActive1235668Swift2INSTALL
9Site DDeselect1235639Retain2DAS
10Site DActive1278537BH2GUP

 

Any help is appreciated.

 

Thanks

1 ACCEPTED SOLUTION
Manjarigoyal1
Frequent Visitor

I found the solution. This video tells exactly what I was looking for.

 

Refer to Previous Row for Subgroups in Power Query - YouTube

View solution in original post

2 REPLIES 2
v-yanjiang-msft
Community Support
Community Support

Hi @Manjarigoyal1 ,

Glad your problem is solved!

 

If you have no other problems, would you mind accept your reply as solution? Then we are able to close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.

 

Best Regards,
Community Support Team _ kalyj

Manjarigoyal1
Frequent Visitor

I found the solution. This video tells exactly what I was looking for.

 

Refer to Previous Row for Subgroups in Power Query - YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors