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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Put a running total clustered with a sum by month

Hello, I have a clustered bar chart on which I grouped the sum of my sales by month. I am using the Date Hierarchy of my date column. I would like to add a bar per month that represents a current total: the sum of that month and previous months, which resets to 0 each December. I have found several pieces of code in the forum but each time it is necessary to remove the DateHierarchy and I therefore end up with a bar per sale, and not a group by month.

How can I do this?

 

At the moment I have this : 

MasTristan_0-1671790724575.png

 

and I would like something like this : 

MasTristan_2-1671790935636.png

 

I hope you'll see the idea

 

I can't calculate a new column direcly because these are the sales filtered by saler and this filter is applicated on the dashboard

Thank you

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Anonymous ,

I created some data:

vyangliumsft_0-1672039627663.png

Here are the steps you can follow:

1. Enter data – create table.

vyangliumsft_1-1672039627664.png

2. Create measure.

Value1 =
SUMX(FILTER(ALL('Table'),
'Table'[Year]=MAX('Table'[Year]) && 'Table'[Month]=MAX('Table'[Month])),[Value])
Value2 =
SUMX(FILTER(ALL('Table'),
'Table'[Year]=MAX('Table'[Year]) && 'Table'[Month]<=MAX('Table'[Month])),[Value])
Group_Value =
IF(
    MAX('Table2'[Group]) ="that month",[Value1],[Value2])

3. Result:

vyangliumsft_2-1672039627669.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi  @Anonymous ,

I created some data:

vyangliumsft_0-1672039627663.png

Here are the steps you can follow:

1. Enter data – create table.

vyangliumsft_1-1672039627664.png

2. Create measure.

Value1 =
SUMX(FILTER(ALL('Table'),
'Table'[Year]=MAX('Table'[Year]) && 'Table'[Month]=MAX('Table'[Month])),[Value])
Value2 =
SUMX(FILTER(ALL('Table'),
'Table'[Year]=MAX('Table'[Year]) && 'Table'[Month]<=MAX('Table'[Month])),[Value])
Group_Value =
IF(
    MAX('Table2'[Group]) ="that month",[Value1],[Value2])

3. Result:

vyangliumsft_2-1672039627669.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Anonymous
Not applicable

The only problem here is that it doesn't seems like the result is filtered by employee but for the rest it is ok so thanks

bolfri
Solution Sage
Solution Sage

Did you try YTD function to achive that?





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

Proud to be a Super User!




Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors