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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
PierreL69
Helper III
Helper III

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
Super User

@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

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


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
Super User

@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

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


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.

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. 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


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.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.