Auto-Fill in new column with if clause

Easd

New member
Joined
Sep 12, 2019
Messages
2
Reaction score
0
Points
0
Excel Version(s)
2016
Dear forum,

I´ve been working with power query for some weeks now, but I am struggling with a problem mentioned below.

Below is an excerpt from a csv-file that I import with power query. The column´s format is text, but it also contains strings that consists only of numbers (i.e. 08800,10000,11200,...). I want to add another column that adds these strings to the different rows. As soon as there appears the next row with numbers, I want that to be added. The additional rows between those
"number-cells" vary from month to month.

I tried some kind of if... then... clause, but I was only able to identify the cells with solo numbers... any hints? (If you have a better solution than "if... then...", of course I would be glad if you share it with me).

Kind regards

aev8sVUaj5QAAAAASUVORK5CYII=
csv.JPG
 
Not sure if I completely understand your objective. But I think your if then else is probably fine. You just need to fill down after the add column.

Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", type text}}),
    #"Add id" = Table.AddColumn(#"Changed Type", "id", each if (try Number.FromText([ID]) otherwise null) = null /* Your number test might be different */ then null else [ID], type text  ),
    #"Filled Down" = [B]Table.FillDown(#"Add id",{"id"})[/B]
in
    #"Filled Down"
 
Thank you very much. With so additional "Trial and Error" I was able to finish that task!
 
Back
Top