Users Online

· Guests Online: 27

· Members Online: 0

· Total Members: 188
· Newest Member: meenachowdary055

Forum Threads

Newest Threads
No Threads created
Hottest Threads
No Threads created

Latest Articles

Power BI Tutorial - Power BI Charts Tutorial

 

Power BI Stacked Bar Chart

Power BI Stacked Bar Chart Bar Chart is useful to compare multiple dimensions against a single measure. Let me show you how to Create a Stacked Bar Chart in Power BI with example.

  

For this Power BI Stacked Bar Chart demonstration, we are going to use the SQL Data Source that we created in our previous article. So, Please refer to Connect Power BI to SQL Server article to understand the Power BI Data Source.

How to Create a Power BI Stacked Bar Chart

To create a Stacked Bar Chart in Power BI, first Drag and Drop the Sales Amount from Fields section to Canvas region. It automatically creates a Column Chart, as shown in the below screenshot.

Power BI Stacked Bar Chart 1

By clicking the Stacked Bar Chart under the Visualization section, it automatically converts the Column Chart into Stacked Bar Chart

Power BI Stacked Bar Chart 2

Next, let me add Color to Axis section to create a Bar chart that shows Sales Amount by Color.

  Power BI Stacked Bar Chart 3

Next, we are adding the English Country Region Name to the Legend section to convert it into the Stacked Bar Chart.

Power BI Stacked Bar Chart 4

This time, we added State Province Name to Axis, and Country to Legend. From the screenshot below, you can see Country Name is acting as the Bar Color. It is because you can’t group the Country Names inside a State ( State Name Inherited from Country). Please remember this while you are working with a stacked bar chart.

Power BI Stacked Bar Chart 5

Hover over any stacked bar shows the Tool-tip of State Name, Country, and its Sales Amount

Power BI Stacked Bar Chart 6

Create a Power BI Stacked Bar Chart Approach 2

First, click on the Stacked Bar Chart under the Visualization section. It automatically creates a Stacked Bar Chart with dummy data, as shown in the below screenshot.

Power BI Stacked Bar Chart 7

In order to add data to the Power BI Stacked Bar Chart, we have to add the required fields:

  • Axis: Please specify the Column that represents the Horizontal Bars.
  • Legend: Specify the Column to divide the Horizontal Bars.
  • Values: Any Numeric value such as sales amount, Total Sales etc.

Let me drag the Sales Amount from the Fields section to the Values field, and Color field to the Axis Section.

Power BI Stacked Bar Chart 8

Next, add the English Country Region Name from the DimGeography table to the Legend section. You can do this by dragging Country to Legend section, or simply checkmark the English Country Region Name column

Power BI Stacked Bar Chart 9

Now you can see a Stacked Bar Chart that represents Sales by Color, which is further divided by Country Name. Hover over any portion on a bar shows the Tool-tip of Color, Country, and its Sales Amount.

Power BI Stacked Bar Chart 10

Let me do some quick formatting to this Power BI Stacked Bar Chart

NOTE: I suggest you refer to Format Stacked Bar Chart article to understand the steps involved in formatting the Stacked Bar Colors, Chart Title, Data Color, background Color, Axis Colors, Axis fonts style and colors, etc. 

 

Power BI Stacked Bar Chart 11

 

 

 

Format Stacked Bar Chart in Power BI

How to Format Stacked Bar Chart in Power BI with an example?. Formatting Power BI Stacked Bar Chart includes changing the Stacked Bar Colors, Title text, position, Data labels, Axis Fonts, and Background Colors, etc.

  

To demonstrate the Power BI Stacked Bar Chart formatting options, we are going to use the Stacked Bar Chart that we created earlier. Please refer to the Power BI Stacked Bar Chart article.

How to Format Stacked Bar Chart in Power BI

Please click on the Format button to see the list of formatting options that are available for this Stacked Bar Chart.

Format Stacked Bar Chart in Power BI 1

Format Stacked Bar Chart General Section

Use this General Section to Change the X Position, Y Position, Width, and height of a Stacked Bar Chart

Format Stacked Bar Chart in Power BI 2

Format Legend of a Stacked Bar Chart in Power BI

To display or enable the Legend, Please select the Power BI Legend region and toggle the option from Off to On. You can use the Position drop down box to change the legend position.

  

As you can see from the screenshot below, we added the Legend Title as Country Name, Legend Position as Top Center. Next, we also changed the  Color to Brown, Font family to Corbel, and text size to 12.

Format Stacked Bar Chart in Power BI 3

The Y-Axis of a Power BI Stacked Bar Chart

As you can see from the screenshot below, we change the Y-Axis labels Color to Brown, Text Size to 18, Font style to Corbel. You can use Minimum category width, Maximum Size, and Inner Padding options to change the bar widths

Format Stacked Bar Chart in Power BI 4

By default, the Y-Axis title set to Off, but you can enable it by toggling Title under the Y-Axis section to On. Let me change the Title Color to Green, Title Text Size to 30, and Font style to Cambria.

Format Stacked Bar Chart in Power BI 5

Format X-Axis of a Stacked Bar Chart in Power BI

As you can see from the below screenshot, we change the Color to Brown, Font style to Corbel, Text Size to 20, Display Units to Thousands (default is Auto).

Format Stacked Bar Chart in Power BI 6

By default, the X-Axis title set to Off, but you can enable it by toggling Title to On. Let me change the Title Color to Green, Font style to Cambria, and Font Size to 30.

By toggling the Gridlines option from On to Off, you can disable the Stacked Bar chart Gridlines.

  • Color: You can change the Gridlines color.
  • Stroke Width: Use this to change the Gridlines width.
  • Line Style: Choose the line style such as Solid, dotted, and dashed.
Format Stacked Bar Chart in Power BI 7

Format Power BI Stacked Bar Chart Data Colors

By default, Power BI allocates some default colors to each bar. Let me change the Color of the United States to Pink.

Format Stacked Bar Chart in Power BI 8

Enable Data Labels for Power BI Stacked Bar Chart

The Stacked Bar chart Data Labels display the information about each individual group of a horizontal bar. In this case, it displays the Sales Amount of each country. To enable data labels, please toggle Data labels option to On.

Let me change the Color to White, Font family to DIN, and Text Size to 10

Format Stacked Bar Chart in Power BI 9

Format Stacked Bar Chart in Power BI Plot Area

You can add Images as the Background of a Stacked Bar Chart using this Plot Area section. For the demonstration purpose, we added one image as the Plot Area Background. 

 

Format Stacked Bar Chart in Power BI 10

Format Stacked Bar Chart in Power BI Title

By toggling the Title option from On to Off, you can disable the Bar Chart title.

As you can see from the screenshot below, we change the Title Text to Sale Amount by Color and Country Name. And we also changed the Font Color to Green, Font Family to Georgia, Font Size to 25, and Title Alignment to center. If you want, you can add the background color to the title as well.

Format Stacked Bar Chart in Power BI 11

Format Background Color of a Stacked Bar Chart in Power BI

You can add the Background color to a Bar Chart by toggling Background option to On. For the demonstration purpose, we added the background color.

Format Stacked Bar Chart in Power BI 12

Format Border of a Stacked Bar Chart

You can add Borders to a Line Chart by toggling the Border option from Off to On.

Format Stacked Bar Chart in Power BI 13

 

Ratings

Rating is available to Members only.

Please login or register to vote.

No Ratings have been Posted.
Render time: 0.68 seconds
10,804,907 unique visits