Forum Discussion

Rate's avatar
Rate
Icon for Helper III rankHelper III
6 years ago
Solved

Starting 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...
  • Anonymous's avatar
    Anonymous
    6 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
    output
    End Balance = var movements = [Movements]
    var startBalance = [Start Balance]
    RETURN
    startBalance + movements