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
SpikeSpiegel_3
Frequent Visitor

Add total bar to bars in clustered column chart

This is the clustered column chart I created and I want to add total bar for each month, so the status is (total, done, in progress, new) and each month has 4 bars for the 4 status. Is there any way to get it done ?

 

 

CCC.jpg

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @SpikeSpiegel_3 ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data.  

vtangjiemsft_0-1703569515578.png

(2) We can create a calculated column.

Month = FORMAT('Table'[date],"mmmm")

(3) We can create a table.

Table 2 = var a=SUMMARIZE('Table','Table'[status])
var b={"Total"}
var c=SUMMARIZE('Table','Table'[Month])
return GENERATEALL(c,UNION(b,a))

(4) We can create a measure.

Measure = 
var _a=CALCULATE(SUM('Table'[value]),FILTER(ALLSELECTED('Table'),'Table'[Month] in VALUES('Table 2'[Month]) && 'Table'[status] in VALUES('Table 2'[Status])))
var _b=CALCULATE(SUM('Table'[value]),FILTER(ALLSELECTED('Table'),'Table'[Month] in VALUES('Table 2'[Month]) ))
return IF(SELECTEDVALUE('Table 2'[Status])="Total",_b,_a)

(5) Then the result is as follows.

vtangjiemsft_1-1703569666049.png

Best Regards,

Neeko Tang

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

2 REPLIES 2
Anonymous
Not applicable

Hi @SpikeSpiegel_3 ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data.  

vtangjiemsft_0-1703569515578.png

(2) We can create a calculated column.

Month = FORMAT('Table'[date],"mmmm")

(3) We can create a table.

Table 2 = var a=SUMMARIZE('Table','Table'[status])
var b={"Total"}
var c=SUMMARIZE('Table','Table'[Month])
return GENERATEALL(c,UNION(b,a))

(4) We can create a measure.

Measure = 
var _a=CALCULATE(SUM('Table'[value]),FILTER(ALLSELECTED('Table'),'Table'[Month] in VALUES('Table 2'[Month]) && 'Table'[status] in VALUES('Table 2'[Status])))
var _b=CALCULATE(SUM('Table'[value]),FILTER(ALLSELECTED('Table'),'Table'[Month] in VALUES('Table 2'[Month]) ))
return IF(SELECTEDVALUE('Table 2'[Status])="Total",_b,_a)

(5) Then the result is as follows.

vtangjiemsft_1-1703569666049.png

Best Regards,

Neeko Tang

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

zenisekd
Super User
Super User

To do this, you would have to add some changes to your tables or calculate a special table from which you would display this. I can tell that it is not tbe best solution... I would suggest perhaps to use the "line and clustered column chart" to display this. Disable the secondary axis and play out with the markers..?

https://learn.microsoft.com/en-us/power-bi/visuals/power-bi-visualization-combo-chart?tabs=powerbi-d...

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!

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