cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PierreL69
Helper II
Helper II

Stacked Column Chart : add Total column

Hello the community,

 

Sorry if my message has already been posted, but I am pretty sure you will find the answer quickly

 

Here my data :

 

data.JPG

 

Here the result and until here everything is fine:

 

Chart.JPG

What I want to do is to add a simple total column like under excel :

 

123.JPG

 

I already found a trick by duplicating the chart and then removing the range value.

And then to finish trying to connect the two graphics as well as possible

but I don't find this solution very convenient.

 

Do you have other tricks please ?

 

Many thanks,

 

Pierre

 

1 ACCEPTED SOLUTION
parry2k
Super User III
Super User III

@PierreL69 solution attached, here are the steps:

 

- unpivot your original table in power query

- create new range table from original table and added a Total row

- create relationship between two tables on Range

- add measure to check if Total then add all values otherwise simple sum

- on visual, use Range on x-axis from new table called Range and on value use measure and legend is Type

 

 






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

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





View solution in original post

7 REPLIES 7
parry2k
Super User III
Super User III

@PierreL69 solution attached, here are the steps:

 

- unpivot your original table in power query

- create new range table from original table and added a Total row

- create relationship between two tables on Range

- add measure to check if Total then add all values otherwise simple sum

- on visual, use Range on x-axis from new table called Range and on value use measure and legend is Type

 

 






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

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





View solution in original post

Thank you very much !

The final result is perfect, much more better than my trick

 

But is this the easiest solution to generate a total?

Because I still find it not very intuitive when you have limited knowledge about Power BI

 

I was hoping there would be a simple button or option to add this total.

In any case, a big thank you

@PierreL69 nothing like adding by click of button afaik. 






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

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





Hi, it is me again,

I just would like to understand why did you use the Max function to find the total?

Because max function work usually with numbers if I am not wrong?

Thanks for your help

 

@PierreL69 it doesn't need to be MAX, it can be MIN, basically we need to use an aggregated function to get the value of ouur Range column, since it is a measure, we cannot use column directly so that's the reason I used MAX. Hope it helps. let me know if you have further question.






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

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





I am still a little bit confused.

 

For example if I replace Max by the Average formula, it could also work?

 

The idea is to use a formula (so an aggregated function), that return one value and to compare it to the value we are looking for

 

Thanks

 

 

Ok thanks for the info,

Now I know the way to do it 🙂

This is the important thing

thanks

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Get Ready for Power BI Dev Camp

Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors