Forum Discussion

Tegzi's avatar
Tegzi
Copper Contributor
Jun 14, 2023
Solved

Calculation within official excel table (structured data)

Hello.   I struggle to find the right function to do this calculation. Let's say we have an official excel table - Table1 - that has 2 columns. The first column - with header "Value" - contains ra...
  • Lorenzo's avatar
    Lorenzo
    Jun 14, 2023

    Hi Tegzi 

    Given you run 365. Does the following do it?:

    Edited:

     

     

    =LET(
      idx, INDEX([Value], SEQUENCE(ROW()-ROW(Table1[#Headers]))),
      flt, FILTER(idx, idx > 0),
      IFS(ISBLANK([@Value]),"", ROWS(flt)=1,[@Value], TRUE,AVERAGE(TAKE(flt,-2)))
    )

Resources