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

100% stacked chart and line chart

Hello,

 

Can I able to create a 100% stacked bar graph that includes a line as well

The table below 

VictoriaNguyen_0-1634080769365.png

Many thanks 

 

1 ACCEPTED SOLUTION

You'll need a measure like this one.  In my case, Year is the x axis and the legend is Product Categories.  This measure is in the values (and a different measure is in the line).

 

Pct of Year Total =
VAR thiscategory = [Total Sales]
VAR allcategory =
    CALCULATE ( [Total Sales], REMOVEFILTERS ( 'Product'[Category] ) )
RETURN
    DIVIDE ( thiscategoryallcategory )

 

mahoneypat_0-1634124726367.png

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

3 REPLIES 3
mahoneypat
Employee
Employee

Yes.  You can use a line and stacked chart with a measure that shows the % of total for that category instead of the actual values (so they all add to 1).  You can add the actual values in the tooltip if needed.

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


@mahoneypat Thank you for your reply. 
How can I write the measure to show the percentages oftotal? I am new to Power BI 

You'll need a measure like this one.  In my case, Year is the x axis and the legend is Product Categories.  This measure is in the values (and a different measure is in the line).

 

Pct of Year Total =
VAR thiscategory = [Total Sales]
VAR allcategory =
    CALCULATE ( [Total Sales], REMOVEFILTERS ( 'Product'[Category] ) )
RETURN
    DIVIDE ( thiscategoryallcategory )

 

mahoneypat_0-1634124726367.png

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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