Forum Discussion
shahid_tanmoy
Helper I
3 years agoHow do I add a row in my power query editor?
Hi there, I have a query that is sourced from a database, I want to add a row to it that is just null or something else written in it. There is no way to practically do it that I can see since th...
ronrsnfld
Super User
3 years agoHere is an example:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("HYzLEcAgCER74eygohGoxfFg/um/gYAHZhd4u73D3A8IsMUcKRGZzVjZRGwqssAIHc7rtrXFYtD6EkpxcV4LMi/seT876OpK2S1y83YPV0FVhTF+", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t, Column4 = _t, Column5 = _t]),
#"Previous Step" = Table.TransformColumnTypes(Source,{
{"Column1", type text}, {"Column2", type date}, {"Column3", type number}, {"Column4", Int64.Type}, {"Column5", Currency.Type}}),
#"Add row of nulls" =
let
#"Null List" = List.Repeat({null}, Table.ColumnCount(#"Previous Step")),
#"Null Row" = Record.FromList(#"Null List", Table.ColumnNames(#"Previous Step")),
#"Add Null Row" = Table.FromRecords(Table.ToRecords(#"Previous Step") & {#"Null Row"})
in
#"Add Null Row"
in
#"Add row of nulls"