cancel
Showing results for
Did you mean:
Highlighted
EmanuelTavares Frequent Visitor

## Summarizing rows

Hi,

I spent a lot of time on this and now I'm looking for help.

I need to summarize lines of an ID. It sounds easy, but the result that I need is a little bit different, and I'm showing it below: I'm looking for the yellow column. All the others I have.

I tried using SUM, SUMX, CALCULATE, SUMMARIZE, .....

There is anyone with an idea to solve this?

Thanks a lot.

1 ACCEPTED SOLUTION

Accepted Solutions Community Support Team

## Re: Summarizing rows

If you want to calculate the column ACUM which you highlight in your image, you could try the steps below.

1. Create the index column in query editor.

2. Create the group index calculated column with dax.

```group index =
RANKX (
FILTER ( 'Table', EARLIER ( 'Table'[ID] ) = 'Table'[ID] ),
'Table'[Index],
,
ASC
)
```

3. Create the measure with the formula below.

```Measure =
CALCULATE (
SUM ( 'Table'[STATUS_] ),
FILTER (
ALLEXCEPT ( 'Table', 'Table'[ID] ),
'Table'[group index] <= MAX ( 'Table'[group index] )
)
)
```

Here is the output. If you still need help, free to ask.

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
5 REPLIES 5
SergioSimionato Frequent Visitor

## Re: Summarizing rows

Hello @EmanuelTavares

Try this function:

MaxAcum = CALCULATE(MAX(Table[Total]);ALLEXCEPT(Table;Table[ID]))
EmanuelTavares Frequent Visitor

## Re: Summarizing rows

Thanks a lot for so fast answer.

It didn't work.

The TOTAL column has the same value to all rows.

Regards.

SergioSimionato Frequent Visitor

## Re: Summarizing rows

sorry brother, i had understood that u need the last value accumulated, but i need a function to sum each value through status =/

EmanuelTavares Frequent Visitor

## Re: Summarizing rows

Relax and thanks for the attempt. Community Support Team

## Re: Summarizing rows

If you want to calculate the column ACUM which you highlight in your image, you could try the steps below.

1. Create the index column in query editor.

2. Create the group index calculated column with dax.

```group index =
RANKX (
FILTER ( 'Table', EARLIER ( 'Table'[ID] ) = 'Table'[ID] ),
'Table'[Index],
,
ASC
)
```

3. Create the measure with the formula below.

```Measure =
CALCULATE (
SUM ( 'Table'[STATUS_] ),
FILTER (
ALLEXCEPT ( 'Table', 'Table'[ID] ),
'Table'[group index] <= MAX ( 'Table'[group index] )
)
)
```

Here is the output. If you still need help, free to ask.

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Announcements #### Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system. #### Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge. #### Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests! #### Power Platform Online Conference 