rism
rism

Reputation: 12142

Running total not aggregating on line chart

A table with some sales data has an associated running total measure. When viewed in Data view of PowerBi Desktop the data does reflect an aggregated total.

Power Bi Running Total

However when applied to a line chart the running total is simply the monthly totals. The expectation would be that a running total never decreases (assuming only positive sales) and that the line chart would reflect the values in the measure. So month by month should actually be 500, 1500, 3000.

enter image description here

Update 1: As per Foxans suggestion - same result:

enter image description here

Update 2: Works when using an index instead of a date (dd/MM/yyyy):

enter image description here

enter image description here

Upvotes: 1

Views: 4323

Answers (1)

Foxan Ng
Foxan Ng

Reputation: 7151

You ISONORAFTER filter should be based on Date instead of Spend for a running total (Or in the absence of a date column, should be the column which can identify the order you're trying to summarize, e.g. an incremental index), i.e.

Spend running total in Date = 
CALCULATE(
    SUM(Spend[Spend]),
    FILTER(
        ALLSELECTED(Spend),
        ISONORAFTER(Spend[Date], MAX(Spend[Date]), DESC)
    )
)

results

It's causing some confusion here because your sample data in Spend column is coincidentally in ascending order of values (100 -> 200 -> 300). If you update it to some random data, you'll notice it won't work in the first place.

Upvotes: 2

Related Questions