Forum Discussion

uthall's avatar
uthall
Helper II
5 years ago
Solved

Burndown Column

Hello, I have a column (A) in a table that has numbers. I want a new column (B) that is the result of the total sum of column A minus the row value for column A   A B 3 107 4 106 2...
  • Jimmy801's avatar
    5 years ago

    Hello uthall 

     

    add a custom column with this formula. You have to replace the PreviousStep with the name of your previous step

    List.Sum(YourPreviousStep[A])-[A]

    Here the complete code to copy into the advanced editor

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlaK1YlWMgGTRmDSFEyag0kLS6XYWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [A = _t]),
        YourPreviousStep = Table.TransformColumnTypes(Source,{{"A", Int64.Type}}),
        #"Added Custom" = Table.AddColumn(YourPreviousStep, "B", each List.Sum(YourPreviousStep[A])-[A], type number)
    in
        #"Added Custom"

    Copy paste this code to the advanced editor in a new blank query to see how the solution works.

    If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
    Kudoes are nice too

    Have fun

    Jimmy

  • Anonymous's avatar
    Anonymous
    5 years ago

    uthall 

    Basically you can just add a custom column on top of the previous step (underlined) using the following code:

     

    Result:


    Paul Zheng _ Community Support Team
    If this post helps, please Accept it as the solution to help the other members find it more quickly.