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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Ali_Chibani
Frequent Visitor

Adding totals to a clustered column chart

Hello everyone,

 

I created a dummy spreadsheet and PBI files to help me explain the issue I am facing since I am working on confidential data.

 

I am trying to create a clustered column chart in which I display car sales by type as you can see in the image below.

 

Ali_Chibani_0-1715968228988.png

 

 

As you can see, there are three car types. I want to add a fourth column that displays total sales (i.e., the sum of sales of all three types). I thought of adding new rows to my table that calculate total sales per month; however, I am tempted not to alter my table.

 

I would highly appreciate your support on this.

 

Sincerely,

Ali 

 

2 ACCEPTED SOLUTIONS
kpost
Super User
Super User

See attached .pbix file containing a working solution.

 

I created a new table like this:

 

Sales_Total = UNION(SELECTCOLUMNS(Sales, "Date", [Date], "Car Type", [Car Type], "Sales", [sales])
                    , SELECTCOLUMNS(Sales, "Date", [Date], "Car Type", "Total", "Sales", [sales]))

Note that in the first one, I pull in [Car Type] for the "Car Type" column, while in the second one, the "Car Type" column is ALWAYS the value "Total".  I then use the [sales] from that table in the visual and [Car type] from that table in the legend.

 

See below.

 

soln.PNG


///Mediocre Power BI advice, but it's free///

View solution in original post

Hey @Ali_Chibani ,

 

here you will find information about the Zebra BI visuals: Zebra BI | Actionable Reporting Made Easy

 

This site explains Deneb: Declarative Visualization in Power BI | Deneb (deneb-viz.github.io)

Here you will find everything related to vega-lite, the grammar o fgraphics that fuels Deneb: Introduction to Vega-Lite | Vega-Lite

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

6 REPLIES 6
kpost
Super User
Super User

See attached .pbix file containing a working solution.

 

I created a new table like this:

 

Sales_Total = UNION(SELECTCOLUMNS(Sales, "Date", [Date], "Car Type", [Car Type], "Sales", [sales])
                    , SELECTCOLUMNS(Sales, "Date", [Date], "Car Type", "Total", "Sales", [sales]))

Note that in the first one, I pull in [Car Type] for the "Car Type" column, while in the second one, the "Car Type" column is ALWAYS the value "Total".  I then use the [sales] from that table in the visual and [Car type] from that table in the legend.

 

See below.

 

soln.PNG


///Mediocre Power BI advice, but it's free///

Hey @kpost,

 

Thank you very much for your prompt response and for sharing the PBI file.

 

It works well now!

 

Sincerely,

Ali

 

 

TomMartens
Super User
Super User

Hey @Ali_Chibani,

 

this is simply not possible using the default charts,, and to be honest, I think it will have a great impact on the readibility of a column chart due to the size of the totak values.

 

From my knowledge a Total can be visualized by the Zebra BI visual and of course you create this as well using the custom visual Deneb (using an aggregate transform). I'm sure there are more custom visuals that provide this kind of "feature".

 

Hopefully, this provides you some ideas of how to tackle your challenge.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Hey @TomMartens,

 

Thank you very much for your prompt response and for your vital suggestions!

 

I am relatively new to Power BI, so would you kindly be able to share with me some resources through which I can learn more about Zebra BI visuals and the custom visual Deneb?

 

Sincerely,

Ali 

Hey @Ali_Chibani ,

 

here you will find information about the Zebra BI visuals: Zebra BI | Actionable Reporting Made Easy

 

This site explains Deneb: Declarative Visualization in Power BI | Deneb (deneb-viz.github.io)

Here you will find everything related to vega-lite, the grammar o fgraphics that fuels Deneb: Introduction to Vega-Lite | Vega-Lite

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Hello @TomMartens,

 

Thank you very much, I appreciate it.

 

Sincerely,

Ali 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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