Author avatar

Deepika Singh

Aligning Charts with Gridlines in Power BI

Deepika Singh

  • Nov 23, 2020
  • 7 Min read
  • 256 Views
  • Nov 23, 2020
  • 7 Min read
  • 256 Views
Microsoft Power BI
Data
Business Intelligence
Data Analytics

Introduction

Building powerful visualization is good, but it is important to make sure that all the charts are aligned properly. This increases the appeal of the visualization and makes it easier to comprehend. In this guide, you will learn how to align charts with gridlines in Power BI Desktop.

Data

In this guide, you will work with a fictitious data set of bank loan disbursal across years. The data contains 3,000 observations and 17 variables. You can download the dataset here. The major variables are described below:

  1. Date: Loan disbursal date.
  2. Income: Annual Income of the applicant (in US dollars).
  3. Loan_disbursed: Loan amount (in US dollars) disbursed by the bank.
  4. Age: The applicant’s age in years.
  5. Gender: Whether the applicant is female (F) or male (M).
  6. Interest_rate: Annual interest rate, in percentage, charged for the disbursed loan.
  7. Purpose: Purpose for which loan was taken.
  8. Weeknum: Week number of the year.

Start by loading the data.

Loading Data

Once you open your Power BI Desktop, the following output is displayed.

b1

Click on Get data option and select Excel from the options.

b2

Browse to the location of the file and select it. The name of the file is BIdata.xlsx, and the sheet you will load is BIData sheet. The preview of the data is shown, and once you are satisfied that you are loading the right file, click Load.

b3

You have loaded the file, and you can save the dashboard. It is named PowerBI Visualization. The Fields pane contains the variables of the data.

b4

Adding Visualizations

To begin, you will need a chart, table or a matrix. You will create a Clustered column chart in this guide. You can locate it in the Visualizations pane. Click on the chart and it will create a chart box in the canvas. Nothing is displayed because you haven't yet added the required visualization arguments.

sv1 You can resize the chart on the canvas. The next step is to fill the visualization arguments under the Fields option as shown below. Drag the variable Date into the Axis field, and Loan_disbursed in the Values field.

sv2

The output above shows the Loan_disbursed by Year chart. Next, you will add a Line chart.

sv3

Drag the variable Date into the Axis field, and Interest_rate in the Values field.

sv4

The above line chart is incorrect as it adds the interest rate values. To make the correction, right click and select Average.

sv5

The above step will produce the following output.

g6

You have added two charts at the top of the visualization canvas. You will add two more charts to properly demonstrate the importance of gridlines.

You will add a Gauge chart for the variable, Loan_disbursed, as shown below.

g7

Next, click on the Pie chart visual.

g8

Drag Purpose in the Legend option, and Loan_disbursed in the Values field.

G9

You now have your visualization report ready.

Gridlines and Snap to Grid

In order to align the charts properly, Power BI Desktop has a great feature called Gridlines and Snap to grid, which allows you to make your report look nice and properly aligned. Under the View tab you will see these two options.

g10

Turn on these two options and you can see gridlines existing for this dashboard.

g11

You can now ensure that all the charts are around the same size and evenly distributed across the report. In case of any discrepancy, you can correct the alignment. For example, the gauge chart is too big and out of the alignment.

g12

It is easy to align this chart by dragging it within the gridlines.

g13

Once you have aligned the chart, you can turn off the Gridlines and Snap to grid option.

g14

Now you have all the charts aligned and you can share your well-aligned and formatted chart to your team.

Conclusion

Proper formatting of a visualization chart is a must-have skill in analytics and business intelligence. It helps to increase the aesthetic appeal of your report and also makes it easy for others to comprehend. This is an essential skill requirement in consulting and auditing firms. It is also required when you present the findings to senior management. This skill set will strengthen your visualization and presentation skillsets.

To learn more about building powerful visualization in Power BI Desktop, please refer to the following guides:

1