Forum Discussion
Stuck on Creating reverse running total based on other columns
- 4 years ago
Hi CameronKudos
I believe you need to do a grouped running total. The only difference is that you need to subtract rather than add. My suggestion is multiply daily rate column with -1 and do a grouped total. It should work. You can search for running total grouped on Google and you will get lot of articles. I just found that this one is useful.
https://www.goodly.co.in/running-total-power-query/
Let me know how this works.
Thanks
Hi CameronKudos
I believe you need to do a grouped running total. The only difference is that you need to subtract rather than add. My suggestion is multiply daily rate column with -1 and do a grouped total. It should work. You can search for running total grouped on Google and you will get lot of articles. I just found that this one is useful.
https://www.goodly.co.in/running-total-power-query/
Let me know how this works.
Thanks
- CameronKudos4 years agoHelper I
Thanks for that. this is the code that I went with, but it didn't work. Where do I put the minus symbol? Should I not be using the Index column?
= Table.AddColumn(
BufferedTable,
"Running Total",
(OutTable) =>
List.Sum(
Table.SelectRows(
BufferedTable,
(InTable) => InTable[Index] <= OutTable[Index]
and
InTable[Daily_Rate_Based_On_Days_Remaining__c] = OutTable[Daily_Rate_Based_On_Days_Remaining__c])[Total_Remaining_Cost__c])) - CameronKudos4 years agoHelper I
All good, I got it by adding a running total to the daily rate, then using that colum to subtract from the total amount remaining. Thank you