Forum Discussion

Yggdrasill's avatar
Yggdrasill
Icon for Responsive Resident rankResponsive Resident
8 years ago
Solved

Add Custom Row (Table.InsertRow)

Hi !     I have a dimension table with few rows and few values from a database.   I want to add a custom row to this table without having to create a new one and Append.   Is this possib...
  • stretcharm's avatar
    8 years ago

     

    InsertRows will do what you want.

     

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUXIE4sjUYqVYnWglIyDbCcaPBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Dimension = _t, #"Dimension Name" = _t, #"From Data Source" = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Dimension", Int64.Type}}),
        Custom1 = Table.InsertRows(#"Changed Type",2, { [Dimension = 3, Dimension Name = "Custom Row", From Data Source = "No"] })
    in
        Custom1
  • stretcharm's avatar
    8 years ago

     

    InsertRows will do what you want.

     

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUXIE4sjUYqVYnWglIyDbCcaPBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Dimension = _t, #"Dimension Name" = _t, #"From Data Source" = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Dimension", Int64.Type}}),
        Custom1 = Table.InsertRows(#"Changed Type",2, { [Dimension = 3, Dimension Name = "Custom Row", From Data Source = "No"] })
    in
        Custom1