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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Adding a column or table with skipped rows

Hi!

Capture.PNG

I managed to check how many "Nro. Comprob." rows are getting skipped. Now I'm trying to get which rows are getting skipped and I would like to add them to a new column or a new table, but I'm not being able to do it. I'd appreciate any advice.

Thanks in advance for any help!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

try this

 

 

let
    Origine = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSgWAzSyBpZGQM4jgqxepEKxmhS5nDpYzRpEzM4FImaFKmBnApU3QpqF2xAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [indice = _t, tp = _t, vita = _t, nc = _t, desc = _t]),
    #"Modificato tipo" = Table.TransformColumnTypes(Origine,{{"indice", Int64.Type}, {"tp", Int64.Type}, {"vita", Int64.Type}, {"nc", Int64.Type}, {"desc", type text}}),
    #"Aggiunta colonna personalizzata" = Table.AddColumn(#"Modificato tipo", "NrComprCompleta", each try {[nc]..#"Modificato tipo"[nc]{[indice]}-1} otherwise {[nc]}),
    #"Tabella NrComprCompleta espansa" = Table.ExpandListColumn(#"Aggiunta colonna personalizzata", "NrComprCompleta")
in
    #"Tabella NrComprCompleta espansa"

View solution in original post

4 REPLIES 4
wdx223_Daniel
Super User
Super User

assume the Nro. Comprob column is the forth column, then try this

NewStep=#table(Table.ColumnNames(PreviousStepName)&{"Skipped rows"},List.Accumulate(Table.ToRows(PreviousStepName),{{},null},(x,y)=>{x{0}&{y&{y{3}-x{1}+1}},y{3}}){0})

Anonymous
Not applicable

Thanks for your response! I'll try it!

Anonymous
Not applicable

try this

 

 

let
    Origine = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSgWAzSyBpZGQM4jgqxepEKxmhS5nDpYzRpEzM4FImaFKmBnApU3QpqF2xAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [indice = _t, tp = _t, vita = _t, nc = _t, desc = _t]),
    #"Modificato tipo" = Table.TransformColumnTypes(Origine,{{"indice", Int64.Type}, {"tp", Int64.Type}, {"vita", Int64.Type}, {"nc", Int64.Type}, {"desc", type text}}),
    #"Aggiunta colonna personalizzata" = Table.AddColumn(#"Modificato tipo", "NrComprCompleta", each try {[nc]..#"Modificato tipo"[nc]{[indice]}-1} otherwise {[nc]}),
    #"Tabella NrComprCompleta espansa" = Table.ExpandListColumn(#"Aggiunta colonna personalizzata", "NrComprCompleta")
in
    #"Tabella NrComprCompleta espansa"
Anonymous
Not applicable

Thank you very much! I adapted it and it worked very well!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.

Top Solution Authors