Iago Alibune
Iago Alibune

Reputation: 36

Cumulative running total based on count PowerBI measure

I'm trying to create a chart with 3 informations:

The first two informations are working, but I can't make the third one work, my chart look like this

Chart Example

And I need it to look like this

Goal Example

Basically, the upper line is a cumulative sum of the lower line, the problem is that the values of the bars are just a count on my table and the lower line I made using the PowerBI function "Show as % of total" I've tried googling but no luck with this one, tried this measure but didn't work:

Running Total MEASURE = 
CALCULATE (
    COUNT ( 'Primes Encerrados'[Nome Cliente] ),
    FILTER (
        ALL ( 'Primes Encerrados' ),
        'Primes Encerrados'[Data] <= MAX ( 'Primes Encerrados'[Data] )
    )
)

Upvotes: 0

Views: 772

Answers (1)

Peter
Peter

Reputation: 12295

  1. Use a the Quick Measure feature to get your running total formula:

enter image description here

  1. Power BI will generate this formula for you:
Primes encerrados running total in Dias = 
CALCULATE(
    SUM('Geral'[Primes encerrados]),
    FILTER(
        ALLSELECTED('Geral'[Dias]),
        ISONORAFTER('Geral'[Dias], MAX('Geral'[Dias]), DESC)
    )
)
  1. Add the measure to your chart and show it as % of Grand Total like you did with the first line

enter image description here

Upvotes: 1

Related Questions