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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
whulsbergen
Helper II
Helper II

Running total per age group (no date-column)

What am I doing wrong?

I need to find the average age group that people die of COVID-19. So I thought first to make a calculated column of Running Total deaths per age category. And then find the value that is just over half of the total number of deaths and produce the corresponding age-group.

 

The first step already doesn't work for me. I tried all the community posts I could find but no answer.

 

Calculated column

Schermafbeelding 2020-03-31 om 08.14.49.png

Table:

Schermafbeelding 2020-03-31 om 08.15.07.png

 

As you can see the table just shows the total number of deaths on each row.

I tried the formula without "FILTER", but that returns an error:

 

Schermafbeelding 2020-03-31 om 08.22.02.png

 

Please help!

6 REPLIES 6
v-diye-msft
Community Support
Community Support

Hi @whulsbergen 

 

If you've fixed the issue on your own please kindly share your solution. if the above posts help, please kindly mark it as a solution to help others find it more quickly.thanks!

 

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
amitchandak
Super User
Super User

@whulsbergen , Your formula is correct, but that is measure not column.

ok. In other posts it looked like the measure and column-solutions were almost identical, and columns I can see quicker what it looks like, but let me try measure instead..

 

Well, it worked! 

 

opgeteld overleden =
VAR RT =
CALCULATE(
SUM('Confirmed COVID-19 cases by sex and age'[Deaths]);
FILTER(
ALL('Confirmed COVID-19 cases by sex and age');
'Confirmed COVID-19 cases by sex and age'[Index] <= max ( 'Confirmed COVID-19 cases by sex and age'[Index] )
))
VAR TOTALD = CALCULATE(sum('Confirmed COVID-19 cases by sex and age'[Deaths]);ALLSELECTED())
RETURN
DIVIDE(RT;TOTALD;0)
 
Schermafbeelding 2020-03-31 om 08.47.43.png
 
Next step: finding the 50% category (80-84y)
 
And I still don't know what went wrong with the column. But I'm out of the woods for now!
 
 
 

Try like

opgeteld overleden =

RETURN
DIVIDE(CALCULATE(
SUM('Confirmed COVID-19 cases by sex and age'[Deaths]);
FILTER(
ALL('Confirmed COVID-19 cases by sex and age');
'Confirmed COVID-19 cases by sex and age'[Index] <= max ( 'Confirmed COVID-19 cases by sex and age'[Index] )
));CALCULATE(sum('Confirmed COVID-19 cases by sex and age'[Deaths]);ALL('Confirmed COVID-19 cases by sex and age'));0)

miltenburger
Helper V
Helper V

Hi @whulsbergen 

 

Can you try following:

 

 

Cumulative Quantity =
CALCULATE (
    SUM ( 'Confirmed COVID-19 cases by sex and age'[Deaths] ),
    FILTER (
        ALL ( 'Confirmed COVID-19 cases by sex and age' ),
        'Confirmed COVID-19 cases by sex and age' [Index] <= MAX ( 'Confirmed COVID-19 cases by sex and age' [Index] )
    )
)

 

Tried. Shows something different now. No Totals running yet 😞

Schermafbeelding 2020-03-31 om 08.39.48.png

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.