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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.