cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Regular Visitor

Cumulative calculations not working

Hi all,

 

Hoping someone might be able to help.

 

I'm trying to create a running total to use in a line graph but my data refuses to cumulate.  I've read numerous theards and tried to use 'Quick Measures' without any success.  I'm starting to wonder if my data table is the problem.

 

Here is a screen shot of my data table:

 

Power BI Data Table.PNG

 

I want the Client ID (Count Distinct) Column to cumulate over time based on the Outcome Date Column.  I'm currently using the following formula to calculate this without much luck:

 

Running Total Outcomes = CALCULATE([Total Hard Outcomes],FILTER(ALL('Cumulative HO Data 14-/15 - 16/17'[Outcome Date]),'Cumulative HO Data 14-/15 - 16/17'[Outcome Date] <= Max('Cumulative HO Data 14-/15 - 16/17'[Outcome Date])))

 

When I try to insert this measure into a matrix

 

Power BI Matrix example.PNG

 

Any help/advice would be greatly appreciated.

Kind regards,

1 REPLY 1
Microsoft
Microsoft


@SpicyRicey wrote:

Hi all,

 

Hoping someone might be able to help.

 

I'm trying to create a running total to use in a line graph but my data refuses to cumulate.  I've read numerous theards and tried to use 'Quick Measures' without any success.  I'm starting to wonder if my data table is the problem.

 

Here is a screen shot of my data table:

 

Power BI Data Table.PNG

 

I want the Client ID (Count Distinct) Column to cumulate over time based on the Outcome Date Column.  I'm currently using the following formula to calculate this without much luck:

 

Running Total Outcomes = CALCULATE([Total Hard Outcomes],FILTER(ALL('Cumulative HO Data 14-/15 - 16/17'[Outcome Date]),'Cumulative HO Data 14-/15 - 16/17'[Outcome Date] <= Max('Cumulative HO Data 14-/15 - 16/17'[Outcome Date])))

 

When I try to insert this measure into a matrix

 

Power BI Matrix example.PNG

 

Any help/advice would be greatly appreciated.

Kind regards,


@SpicyRicey

You can try to create a measure as below.

[Running Total Outcomes ] =
SUMX (
    FILTER (
        ALL ( 'Cumulative HO Data 14-/15 - 16/17' ),
        'Cumulative HO Data 14-/15 - 16/17'[outcome date ]
            <= MAX ( 'Cumulative HO Data 14-/15 - 16/17'[outcome date ] )
    ),
    'Cumulative HO Data 14-/15 - 16/17'[client id ]
)

ddddddddddddd.png

Helpful resources

Announcements
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Wave Release 2

Check out the updates in Power BI.

Overview of Power BI 2020 release wave 2!

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors