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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.