Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Line Charts with Cumulative values

Hello   Firstly, I'm only a beginner with Power BI so please forgive me if this is a silly question.   I'm graphing my actual expenditure to date as a cumulative total however the line continues ...
  • Anonymous's avatar
    Anonymous
    7 years ago

    Give this a try:

    Cumulative payments = var contextDate = MAX('Calendar'[Date])
    var output = CALCULATE(
    	SUM('Money Transfers 201819'[MT amount for charts]),
    	FILTER(ALL('Calendar'[Date]),
    	'Calendar'[Date] <= contextDate)
    )
    RETURN
    IF(
    	contextDate <= Today(),
    	output
    )