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
Anonymous
Not applicable

Fill Up or Down or both by Batch ID

I have a table with the values below.  On the left is the current state. On the right is where I need to get to.  Effectively, I need to fill the "Bank Account" value on all records where the Batch ID is the same.  If there is no Bank Account, nothing should happen.  The catch for me is that the value could be on the first, last or any record in between so the fill is either up, down, or both up and down.

 

Appreciate any help or direction.

 

Thanks!!

 

LloydW_0-1666041749352.png

 

1 ACCEPTED SOLUTION

NewStep=Table.Combine(Table.Group(PreviousStepName,{"Batch Index","Trans Index"},{"n",each let a=List.RemoveItems([Bank Account],{"",null}){0}? in Table.TransformColumns(_,{"Bank Account",each if _=null or _="" then a else _})},0,(x,y)=>Byte.From(x[Batch Index]<>y[Batch Index] or y[Trans Index]=1))[n])

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

@wdx223_Daniel 

 

This works PERFECTLY with the exception of transactions like the following (my apologies this scenario was not included in my original post):

 

LloydW_0-1666059872820.png

Basically, only fill the null values if there are any.

 

Thank you again for your help!!

Best,

LloydW

 

 

NewStep=Table.Combine(Table.Group(PreviousStepName,{"Batch Index","Trans Index"},{"n",each let a=List.RemoveItems([Bank Account],{"",null}){0}? in Table.TransformColumns(_,{"Bank Account",each if _=null or _="" then a else _})},0,(x,y)=>Byte.From(x[Batch Index]<>y[Batch Index] or y[Trans Index]=1))[n])

Anonymous
Not applicable

Absolutely AMAZING!!  Thank you soooooo much!!!

wdx223_Daniel
Community Champion
Community Champion

NewStep=Table.Combine(Table.Group(PreviousStepName,{"Batch Index","Trans Index"},{"n",each let a=List.RemoveItems([Bank Account],{"",null}){0}? in Table.TransformColumns(_,{"Bank Account",each a})},0,(x,y)=>Byte.From(x[Batch Index]<>y[Batch Index] or y[Trans Index]=1))[n])

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.