Forum Discussion
Calculate Difference between change in value
- 7 years ago
Try this pattern
Calc col = [Value] - MINX ( TOPN ( 1, FILTER ( Table1, [Ctg] = EARLIER ( [Ctg] ) && [Date] < EARLIER ( [Date] ) ), [Date], DESC ), [Value] )
Try this pattern
Calc col =
[Value]
- MINX (
TOPN (
1,
FILTER ( Table1, [Ctg] = EARLIER ( [Ctg] ) && [Date] < EARLIER ( [Date] ) ),
[Date], DESC
),
[Value]
)
- shishir9997 years agoHelper II
Thanks 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
- Zubair_Muhammad7 years agoCommunity Champion
This is how it works for each row to get the previous Cumulative Value
1) First Filter gets a filtered table with all dates less than current row date
2) TOPN on this Filtered Table gets the lastrow from the Filtered Table
3) MINX is used to get the Value on this Date
so basically the flow is MINX<<<TOPN<<<<Filter
- shishir9997 years agoHelper II
Thanks alot for explaination.
Regards
Shishir Goel