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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Sum cumulative measure at the top of the graph

Hello

 

I have posted my question in the spanish forum and now I cannt delete it from there, can the admin remove it from https://community.powerbi.com/t5/Desktop/sum-of-running-total-on-top-of-the-Line-and-Stacked-column-... please?

 

I need to display the sum total of a cumulative measure at the top of the graph. I am using Line and Stacked column chart and the running total is calculated by

 

Cumalative Cash Flows = CALCULATE (sum ('sample datatype' [Cash Flow]),
filter(
ALLSELECTED ('sample datatype'),
'sample datatype' [Financial Year] <= Max ('sample datatype' [Financial Year])
)
)

 

 

As shown above, the line values ​​are showing in the wrong place with the wrong values, how can I fix this?

 

Thank you

 

I do not think a sample data is required, however, the below table shows a sample data

 

Asset typeCash FlowFinancial Year
11002020
12002021
13002022
14002023
15002024
16002025
17002026
28002020
29002021
210002022
211002023
212002024
213002025
214002026
315002020
316002021
317002022
318002023
319002024
320002025
321002026
422002020
423002021
424002022
425002023
426002024
427002025
428002026
529002020
530002021
531002022
532002023
533002024
534002025
535002026
1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

You can't use the same measurement for both of us. It actually works for your series of lines and is the column that is incorrect. Please try this for column one, and use an existing one for the line.

Cumalative Cash Flows - CALCULATE (sum ('sample data type' [Cash Flow]),
filter(
ALLSELECTED ('sample data type'[Financial Year]),
'sample data type' [Financial Year] <- Max ('sample data type' [Financial Year])
)
)

If this works for you, mark it as the solution. Praise is also appreciated. Please let me know if you don't.

Best regards

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

9 REPLIES 9
mahoneypat
Microsoft Employee
Microsoft Employee

You can't use the same measurement for both of us. It actually works for your series of lines and is the column that is incorrect. Please try this for column one, and use an existing one for the line.

Cumalative Cash Flows - CALCULATE (sum ('sample data type' [Cash Flow]),
filter(
ALLSELECTED ('sample data type'[Financial Year]),
'sample data type' [Financial Year] <- Max ('sample data type' [Financial Year])
)
)

If this works for you, mark it as the solution. Praise is also appreciated. Please let me know if you don't.

Best regards

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

@mahoneypat

Thanks, your instinct is right, I need two formulas: one for line and one for column,

The one that we identified only works for the line and gives incorrect values for the cumulative of columns.

It works fine on the sample data as I think there are not many filters there, but it gives me incorrect values on my actual dataset.

I will try to replicate the issue with a sample data as my data is sensitive and cannot upload it there. I will ask another question about this new issue.

Anonymous
Not applicable

@mahoneypat 

 

I am using this formula for both and it seems it is working fine, I doubled checked the values manually, are you sure there is a need for two measures?

Maybe I missed something but I needed to do that with your sample data to get this output.

 

mahoneypat_0-1598397873734.png

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


mhossain
Solution Sage
Solution Sage

@Anonymous 

 

Please try this:

 

Cumalative Cash Flows = CALCULATE (sum ('sample datatype' [Cash Flow]),
filter(
ALL ('sample datatype'),
'sample datatype' [Financial Year] <= Max ('sample datatype' [Financial Year])
)
)
Anonymous
Not applicable

This does not work as supposed to, All disables all the visual filters and it will give me wrong answer if users start playing with filters

@Sichanm

try with All(Table[date column])

Anonymous
Not applicable

@mhossain 

 

Can you please explain why are you keep suggesting all and not allselected,

and

why you are sugging also putting a single column in the all while they may be other filters in the report

 

 

Based on my test the below works fine, got the idea from you, but still looking for the above questions

CALCULATE( sum(Output_SSIS[Cash Flow]),filter(ALLSELECTED(Output_SSIS[Financial Year]),Output_SSIS[Financial Year]<=Max(Output_SSIS[Financial Year])))
 
Not the all

@Anonymous 

 

Suggested ignoring date column filter bcoz in the charts in axis was trying to ignore the year filter because we require to ignore the year filter and sum the value at total level.

Sorry for any confusion, your formula looks fine now.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.