Forum Discussion

Dayna's avatar
Dayna
Helper V
3 years ago
Solved

Sum of Last Value Rows

Hello,   I have a measure that is calculating the sum of annual volume by the last stage in the process: Annual Volume (Latest) = CALCULATE(sum(Products[AnnualVolume]), FILTER(Processes, Process...
  • DataInsights's avatar
    3 years ago

    Dayna,

     

    Try this measure:

     

    Annual Volume Total (Latest) =
    SUMX ( VALUES ( Processes[Name] ), [Annual Volume (Latest)] )

     

    The column in VALUES should be the column in your visual. If you need to add multiple columns to your visual, use SUMMARIZE (instead of VALUES) to create unique combinations of the columns in your visual.

     

    I recommend using a column filter instead of a table filter in your original measure. In many cases they return the same result, but it's safer to filter only what you need:

     

    Annual Volume (Latest) =
    CALCULATE (
        SUM ( Products[AnnualVolume] ),
        Processes[Ordering] = MAX ( Processes[Ordering] )
    )