Forum Discussion
Calculate difference with cumulative total
- 6 years ago
Hi Anonymous ,
You can download my proposed solution from here.
Here is the formula for Value Savings:
Value savings = var currentDate = SELECTEDVALUE(Savings[Date]) var priorDate = CALCULATE(LASTDATE('Savings'[Date]), ALLEXCEPT('Savings','Savings'[uniqueID]),'Savings'[Date]<currentDate) RETURN SUM('Savings'[Cumulative Savings]) - CALCULATE(SUM('Savings'[Cumulative Savings]), ALLEXCEPT('Savings',Savings[uniqueID]), 'Savings'[Date]=priorDate)this is how the formula works:
first, it finds the current date
second, it finds the prior date for the same uniqueID
finally, it calculates the difference between the cumulated savings on the current date and the cumulated savings on the prior date.
Here is a screenshot of the final result:
Does this help you?
LC
Interested in Power BI and DAX tutorials? Check out my blog at www.finance-bi.com
Hi Anonymous ,
You can download my proposed solution from here.
Here is the formula for Value Savings:
Value savings =
var currentDate = SELECTEDVALUE(Savings[Date])
var priorDate = CALCULATE(LASTDATE('Savings'[Date]), ALLEXCEPT('Savings','Savings'[uniqueID]),'Savings'[Date]<currentDate)
RETURN
SUM('Savings'[Cumulative Savings]) - CALCULATE(SUM('Savings'[Cumulative Savings]), ALLEXCEPT('Savings',Savings[uniqueID]), 'Savings'[Date]=priorDate)this is how the formula works:
first, it finds the current date
second, it finds the prior date for the same uniqueID
finally, it calculates the difference between the cumulated savings on the current date and the cumulated savings on the prior date.
Here is a screenshot of the final result:
Does this help you?
LC
Interested in Power BI and DAX tutorials? Check out my blog at www.finance-bi.com
- Anonymous6 years agoNot applicable
- lc_finance6 years agoSolution Sage
Wonderful!
Do not hesitate if you have any more questions,
LC