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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
krishb1414
Helper III
Helper III

Cumulative sum on average value and month as axis

Hi Everyone,

 

I have average measure and I want to show bar chart with average by year and drill down to month. 

while showing in month I want values like cumulative. 

For example, Jan = Jan, Feb= Jan + Feb like this.

 

Measure: calculate ([average measure], filter(all(dim_date), dim_date <= max(dim_date).


 as per above measure I m getting sum by month
 but not cumulative value. 

  • Any one help me on this , Thanks 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @krishb1414 ,

Based on my testing again, please try the following methods again:

1.Create the sample table.

vjiewumsft_0-1719545043415.png

2.Create the new measure to calculate the month average.

Month average = AVERAGEX('Table date', 'Table date'[Values])

3.Create the new measure to cumulative sum average.

Cumulative sum month = 
var sel_year = SELECTEDVALUE('Table date'[Year])
var sel_month = SELECTEDVALUE('Table date'[Month])
VAR _vtable = SUMMARIZE(ALLSELECTED('Table date'), 'Table date'[Year], 'Table date'[Month], "_Sum", [Month average])
VAR _vtable2 = ADDCOLUMNS(_vtable, "_Less", SUMX(FILTER(_vtable,[Month] <= sel_month && [Year] = sel_year), [_Sum]))
RETURN 
SUMX(FILTER(_vtable2, [Month] = MAX('Table date'[Month]) && [Year] = MAX('Table date'[Year])), [_Less])

4.Drag the measures into the bar chart. Set the Date column to show year and month.

vjiewumsft_1-1719545058739.png

5.The result is shown below.

vjiewumsft_2-1719545102614.png

 

Best Regards,

Wisdom Wu

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

1 REPLY 1
Anonymous
Not applicable

Hi @krishb1414 ,

Based on my testing again, please try the following methods again:

1.Create the sample table.

vjiewumsft_0-1719545043415.png

2.Create the new measure to calculate the month average.

Month average = AVERAGEX('Table date', 'Table date'[Values])

3.Create the new measure to cumulative sum average.

Cumulative sum month = 
var sel_year = SELECTEDVALUE('Table date'[Year])
var sel_month = SELECTEDVALUE('Table date'[Month])
VAR _vtable = SUMMARIZE(ALLSELECTED('Table date'), 'Table date'[Year], 'Table date'[Month], "_Sum", [Month average])
VAR _vtable2 = ADDCOLUMNS(_vtable, "_Less", SUMX(FILTER(_vtable,[Month] <= sel_month && [Year] = sel_year), [_Sum]))
RETURN 
SUMX(FILTER(_vtable2, [Month] = MAX('Table date'[Month]) && [Year] = MAX('Table date'[Year])), [_Less])

4.Drag the measures into the bar chart. Set the Date column to show year and month.

vjiewumsft_1-1719545058739.png

5.The result is shown below.

vjiewumsft_2-1719545102614.png

 

Best Regards,

Wisdom Wu

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

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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