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
cymorg
Resolver I
Resolver I

Conditional fill transformation based on preceding value

How would I transform column 1 such that blank values are replaced with the value from the preceding row, so rows 266 & 267 would contain "Use Of Fire Evacuation Chai", row 270 "2001 Manual Handling (Indoor), 272 "1251 Cscs - Health And Safety At" etc.  

 

In psudo code it would be something like...

 

if currentRow.column1.value does not contain data then currentRow.column1.value = precedingRow.column1.value

 

PowerBIa.jpg

1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

@cymorg 

 

 

Ok, Please follow this:

 

1. Select your column

2. Go to Tranform - Replace Values 

 

Value to Find    --- Empty

Replace with ---- null

 

SS.png

 

3. Transform ---Fill Down

 

SS2.png

 

Ready

 

Regards

 

Victor

 

 




Lima - Peru

View solution in original post

5 REPLIES 5
v-yuta-msft
Community Support
Community Support

@cymorg ,

 

So your requirement is to refer to previous or next row in power query, right? You can achieve this without adding an addtional index column, please refer to this blog: https://www.thebiccountant.com/2018/07/12/fast-and-easy-way-to-reference-previous-or-next-rows-in-po...

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Vvelarde
Community Champion
Community Champion

@cymorg 

 

Hi, In Query Editor with Fill Down Option.

 

Regards

 

Victor




Lima - Peru

In this scenario "In Query Editor with Fill Down Option" does nothing.

Vvelarde
Community Champion
Community Champion

@cymorg 

 

 

Ok, Please follow this:

 

1. Select your column

2. Go to Tranform - Replace Values 

 

Value to Find    --- Empty

Replace with ---- null

 

SS.png

 

3. Transform ---Fill Down

 

SS2.png

 

Ready

 

Regards

 

Victor

 

 




Lima - Peru

@Vvelarde Victor - So, Transform --- Fill Down creates a Table.FillDown M Query function call.  This function acts on the specified  column's null values, ignoring non-null values.  Therefore, converting empty strings to null before calling this function results in the desired outcome.

It's perfectly clear now thanks to you. 10/10 Thanks.Robot Happy

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.