Forum Discussion
shishir999
Helper II
8 years agoCalculate Difference between change in value
Hi, In general, we calculate the Cummulative Total of the values, but my requirement is to get the each day change in value based on Cummulative values. See the attachement. Left si...
- 8 years ago
Try this pattern
Calc col = [Value] - MINX ( TOPN ( 1, FILTER ( Table1, [Ctg] = EARLIER ( [Ctg] ) && [Date] < EARLIER ( [Date] ) ), [Date], DESC ), [Value] )
Zubair_Muhammad
Community Champion
8 years ago
Try this pattern
Calc col =
[Value]
- MINX (
TOPN (
1,
FILTER ( Table1, [Ctg] = EARLIER ( [Ctg] ) && [Date] < EARLIER ( [Date] ) ),
[Date], DESC
),
[Value]
)
shishir999
Helper II
8 years agoThanks Zubair for the solution.
I was trying this earlier:
***********************
Var Mx = CALCULATE(MAXX(table, [Value]),
FILTER(table,
[Date] <= EARLIER([Date])
))
Var Mi = CALCULATE(MAXX(Table,[value]),
FILTER(table,
[Date] = MIN([Date])
))
Var diff = Mx- Mi
Return
diff
***************************
Could you please help me to understand the Top 1 use..
Thanks
Shishir