Skip to main content
cancel
Showing results for
Search instead for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper V

## 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, Processes[Ordering] = MAX(Processes[Ordering])))``````

I'm getting the last record based on the index column on the 'processes' table for the order in which the processes go through.

This is working fine, so example data looks like this:

Now, I want the grand total of the processes, so for the above I'd expect a value of 120898123. I'm then going to group this by customer, item, etc etc etc.

Can someone help how I achieve this? I expect another measure, if you could advise it would really be appreciated.

Many thanks,

Dayna

1 ACCEPTED SOLUTION
Super User

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] )
)``````

Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

2 REPLIES 2
Helper V

Thank you @DataInsights !

Super User

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] )
)``````

Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

## Helpful resources

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

#### Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors
Top Kudoed Authors