Forum Discussion
O20
7 years agoNew Member
Running Total for VAR table
I've been trying to calculate a "Months of Supply" similar to what's described here: https://community.powerbi.com/t5/Quick-Measures-Gallery/Days-of-Supply/m-p/635656 I am stuck on the line of ...
v-eachen-msft
Community Support
7 years agoHi O20 ,
You can create a new table to test the results.
__table04 =
ADDCOLUMNS (
__table03,
"DEMAND", SUMX ( FILTER ( __table03, [Date] <= EARLIER ( [Date] ) ), [Sales] )
)
OR
__table04 =
ADDCOLUMNS (
__table03,
"DEMAND", SUMX ( FILTER ( ALL(__table03), [Date] <= EARLIER ( [Date] ) ), [Sales] )
)- O206 years agoNew Member
I appreciate the response. But this is exaclty the same code I posted on my question saying it wasn't working.
Also the "ALL (__table03)" generates a compiling error.
That code is adding up ALL rows on __table03. So the new column on __table04 results in a Grand Total for [Sales] in __table03 rather than a Running Total.
Any other ideas?
Thank you!