Forum Discussion
Anonymous
4 years agoNot applicable
Same column calculation with condition in another column
Hi, I have a following table, and would like to calculate the cost difference from previous month per Product. For example, for Product A, the difference between May and June is 1, June and July ...
- 4 years ago
Anonymous , Create a date column
date = eomonth(date([year], [month], 1),0)
then create a new column
last month Cost =
var _last = eomonth([Date],-1)
return
[cost] - maxx(filter(Table, [Product] = earlier([Product]) && eomonth([Date],0) = _last) , [Cost])
Anonymous
4 years agoNot applicable
amitchandak Thanks for your quick response. It worked!