Forum Discussion
Subtract values from consecutive rows in DAX
Demand AvailableQuantity
0 3551 (3551-0)
-300 3251 (3551-300)
-250 3001 (3251-250)
-780 2221 (3001-780)
-300 1921 (2221-300)
Is there a way to sum two consecutive rows and create a new column in DAX?
I want to start from the first row of AvailableQuantity and subtract Demand from second row and keep doing that for all values.
Is this possible in Power BI?
Anonymous , add an index column in power bi
https://stackoverflow.com/questions/45715963/creating-an-index-column-for-power-bi
the try new column like
new col =minx(filter(Table, [index] = earlier([Index]) -1),[AvailableQuantity]) + [Demand]
but to me it seem like column
sum([AvailableQuantity]) + sumx(filter(Table, [index] <= earlier([Index]) ),[Demand])
1 Reply
- amitchandakSuper User
Anonymous , add an index column in power bi
https://stackoverflow.com/questions/45715963/creating-an-index-column-for-power-bi
the try new column like
new col =minx(filter(Table, [index] = earlier([Index]) -1),[AvailableQuantity]) + [Demand]
but to me it seem like column
sum([AvailableQuantity]) + sumx(filter(Table, [index] <= earlier([Index]) ),[Demand])