Forum Discussion

Aleiadeh's avatar
Aleiadeh
Frequent Visitor
5 years ago

Difference between rows and keep first row value

Greetings,

 

I am trying to add a calculated column or Measure that will return the difference of two rows of a MEASURE (Column B-A, C-B and so on) In the same time I need to keep the first row value (A) as it is.

I tried with below command for calculated cloumn but the first row was wrong I need keep the result "134,685.68" for first column then calculate the difference :

CC_Weekly_Actual_NLU =
[M_Weekly_Actual_NLU-(CALCULATE([M_Weekly_Actual_NLU],
FILTER(Actual_NLU,Actual_NLU[Index.1]=EARLIER(Actual_NLU[Index.0]))))
 
 

Any suggestion to modify the Calculated Column or provide a new Measure formula to provide what I want.

 

Thank you in advance

1 Reply

  • Aleiadeh , Try a new column like

    Column = var _1 = maxx(FILTER('Table', 'Table'[Date] < EARLIER('Table'[Date])),LASTNONBLANKVALUE('Table'[Date],'Table'[M_Weekly_Actual_NLU]))

    return [M_Weekly_Actual_NLU] -_1