Forum Discussion
Rate
Helper III
6 years agoStarting Balance based on Date Slicer
Hello, I am having trouble with using a date slicer to calculate starting balance for a cash balance. So, I want to have a date filter that will allow me to calculate a dinamic starting and e...
- Anonymous6 years ago
Ok we can do this with 3 measures. I've made some assumptions, such as that you have a date table.
Movements = SUM('YourData'[Value])Start Balance = var StartDate = FIRSTDATE('Date Table'[Date]) var output = CALCULATE( [Movements], ALL('YourData'), 'YourData'[Date] < StartDate ) RETURN outputEnd Balance = var movements = [Movements] var startBalance = [Start Balance] RETURN startBalance + movements
Anonymous
6 years agoNot applicable
Ok we can do this with 3 measures. I've made some assumptions, such as that you have a date table.
Movements = SUM('YourData'[Value])Start Balance = var StartDate = FIRSTDATE('Date Table'[Date])
var output = CALCULATE(
[Movements],
ALL('YourData'),
'YourData'[Date] < StartDate
)
RETURN
outputEnd Balance = var movements = [Movements]
var startBalance = [Start Balance]
RETURN
startBalance + movements
- Rate6 years ago
Helper III
Hello Anonymous , that worked great!
Thanks a lot!!