Hi @Melissa,
This thread is a continuation of Dax into power query - #13 by leo_89. I calculated the sum of last 48 half-hour slots using the EpochHH column and named it “Last 24 hrs Raw SAIDI” of a column value. Here is the logic of doing that:
Buffered30mRaw = List.Buffer(Table.Sort( #“Changed Type5”[[EpochHH], [#“30 Mins SAIDI”]],{{“EpochHH”, Order.Ascending}})[#“30 Mins SAIDI”]),
FirstNum = List.Min( List.Buffer(#“Changed Type5”[EpochHH])),
Add24HRaw = Table.AddColumn( #“Changed Type5”, “Last 24 hr Raw SAIDI”, each try List.Sum(List.FirstN( List.Skip( Buffered30mRaw, ([EpochHH] - FirstNum - 47) ), 48 ) ) otherwise null, type number ),
The above formula produced the desired output. Now I want to create a new column that picks the max value of “Last 24 hr Raw SAIDI” column. Here is how I am doing that:
Buffered24hr = List.Buffer(Table.Sort( #“Changed Type5”[[EpochHH], [#“Last 24 hr Raw SAIDI”]],{{“EpochHH”, Order.Ascending}})[#“Last 24 hr Raw SAIDI”]),
FirstNum = List.Min( List.Buffer(#“Changed Type5”[EpochHH])),
Max24HRaw = Table.AddColumn( #“Add24HRawSAIFI”, “Max 24 hr Raw SAIDI”, each try List.Max(List.FirstN( List.Skip( Buffered24hr, ([EpochHH] + FirstNum + 47) ), 48 ) ) otherwise null, type number )
However, the above formula returned the null values. I am not share where am I making the mistake. Any help would be really appreciated: