Power Query - Fill.Up Function

Rana Gray

Board Regular
Joined
Jan 26, 2023
Messages
59
Office Version
  1. 365
Platform
  1. Windows
  2. Web
Hey Everyone,

Is there a way to use the Fill.Up function to Text.Combine a particular column?

Scenario: I have duplicates stacked on top of each other, I want to fill the blank spaces with the data below unless updates were made on the new line. Where I'm stuck is the "Notes:" column. I don't want to exclude previous notes from the more recent notes - I want them to combine when the Fill.Up step happens but just for that column.

Hope someone can help I keep getting syntax errors.
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Hi,

an attempt - Source is the previous step

Power Query:
    A = Table.ColumnNames(Source),
    B = List.Reverse(List.Transform(List.Accumulate(List.Reverse(Source[#"Notes:"]), {}, (s,c)=> s & {c ?? {Text.Combine(List.LastN(s, each Value.Type(_) <> List.Type), " - ")}}), each try _{0} otherwise _)),
    C = Table.FromColumns(List.ReplaceRange(Table.ToColumns(Source), List.PositionOf(A, "Notes:") ,1, {B}), A)

Regards
 
Upvote 0
Looks like you want to remove duplicates, but keep all comments.

The pattern maybe something alike:
Catcomment
ablah
bluh
bleh
ebloh
blih
bbluh
d
oki
doki


Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="data_sample"]}[Content],
    Auto_step_types = Table.TransformColumnTypes(Source,{{"Cat", type text}, {"comment", type text}}),
    Fill_down = Table.FillDown(Auto_step_types,{"Cat"}),
    Group_with_txt_combine = Table.Group(Fill_down, {"Cat"}, {{"Comments", each Text.Combine([comment], "#(lf)"), type nullable text}})
in
    Group_with_txt_combine

CatComments
ablah bluh bleh
ebloh blih
bbluh
doki doki
 
Upvote 0

Forum statistics

Threads
1,226,508
Messages
6,191,444
Members
453,658
Latest member
healmo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top