0
votes

I am trying to calculate a cumulative column according to an existing numeric column (not the date)

in order to build a Pareto chart in Power Bi, I find online calculations that summarize the cumulative value according to the date, I need to summarize according to an another numeric column

Running Total MEASURE = 
CALCULATE (
    SUM ( 'All Web Site Data (2)'[UniquePageviews] ),
    FILTER (
        ALL ( 'All Web Site Data (2)' ),
        'All Web Site Data (2)'[Date] <= MAX ( 'All Web Site Data (2)'[Date] )
    )
)
1
Does it not work like you expect if you simply swap out the date column for the other one that you want to use?Alexis Olson

1 Answers

0
votes

Someone else may be able to provide a more elegant solution, but if I've understood your question the following will give you your cumulative column (replace Existing Numeric Column with your column name):

Running Total MEASURE =
CALCULATE (
    VAR this_row = MAX ( 'All Web Site Data (2)'[Existing Numeric Column] ) RETURN
        CALCULATE (
            SUMX (
                SUMMARIZE (
                    'All Web Site Data (2)',
                    'All Web Site Data (2)'[Existing Numeric Column],
                    "Total", SUM ( 'All Web Site Data (2)'[UniquePageviews] )
                ),
                [Total]
            ),
            FILTER ( ALL ( 'All Web Site Data (2)' ), 'All Web Site Data (2)'[Existing Numeric Column] <= this_row )
        )
)