0
votes

I need to fetch the Maximum value from a table column and parse same (i.e. this maximum value as a parameter) to the same column for subtraction in an added (new) column (called difference):

Example:

    Month_number 
    5
    6
    7
    8
    9
    5 
    5
    6

I need to take the Maximum value "9" of the month_number field and use this(9) a parameter to subtract each record of the same column to then get a new column called "difference" like this:

    Difference
    4
    3
    2
    1
    0
    4
    4
    3
1
It would help if you had an example and a specific question.Alexis Olson
Why not just add a custom column?Ron Rosenfeld
I'm really sorry. I have provided an example to better explain the question. Thanks.ju'blu'

1 Answers

0
votes

Just add a step where you determine the minimum for example

let
    Source = Excel.CurrentWorkbook(){[Name="tblInp"]}[Content],
    min = List.Min(Source[Nr]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Nr", Int64.Type}}),
    Diff = Table.AddColumn(#"Changed Type", "Diff", each [Nr]-min)
in
    Diff