Forum Discussion

murillocosta's avatar
murillocosta
Helper I
3 years ago
Solved

Last row value same column

Hi,

Would someone able to help me to perform the below?

 

I need to calculate a new column which will get the previous row value of one column and perform the calculation below using two another columns of the current row. It's easier to understand checking the image below.

 

You can also find a sample file below:

 

Link: https://easyupload.io/ce1o4x

 

 

  • Total Pallets Hired =
    VAR _sum=SUM('SUMMARIZE'[Total Pallets Hired]) RETURN IF(_sum,_sum,SUMX(FILTER(ALLSELECTED('SUMMARIZE'[Week]),'SUMMARIZE'[Week]<=MAX('SUMMARIZE'[Week])&&CALCULATE(SUM('SUMMARIZE'[Total Pallets Hired]))=0),CALCULATE(SUM('SUMMARIZE'[Total Pallets Hired]),OFFSET(-1,,ORDERBY('SUMMARIZE'[Week])))+[Total Outbound]-[Total Inbound Weekly]))

1 Reply

  • wdx223_Daniel's avatar
    wdx223_Daniel
    Community Champion
    Total Pallets Hired =
    VAR _sum=SUM('SUMMARIZE'[Total Pallets Hired]) RETURN IF(_sum,_sum,SUMX(FILTER(ALLSELECTED('SUMMARIZE'[Week]),'SUMMARIZE'[Week]<=MAX('SUMMARIZE'[Week])&&CALCULATE(SUM('SUMMARIZE'[Total Pallets Hired]))=0),CALCULATE(SUM('SUMMARIZE'[Total Pallets Hired]),OFFSET(-1,,ORDERBY('SUMMARIZE'[Week])))+[Total Outbound]-[Total Inbound Weekly]))