Forum Discussion

Kahrax's avatar
Kahrax
Frequent Visitor
5 years ago
Solved

How to perform integral. Difference between two rows.

How to perform in Power BI.   I have the following tables in excel     A B C 1 Timestamp kW saved kWh saved 2 01.01.2020 00:00:00 20 0 3 02.01.2020 01:00:00 30 =(A3-A2)*24...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Forgot to add the screenshot of the table:

     

    let
    Source = KWHTable,
    Custom1 = Table.FromRows(List.Zip({Source[Timestamp], List.Skip(Source[Timestamp], 1), Source[kW saved],List.Skip(Source[kW saved], 1) }), type table [Timestamp = datetime, Timestamp2 = datetime, kW saved = number, kW saved2 = number] ),
    #"Added Custom" = Table.AddColumn(Custom1, "kWh saved", each Number.From([Timestamp2] - [Timestamp])*24*(([kW saved2] + [kW saved])/2), type number)
    in
    #"Added Custom"