This is part 3 of the Getting Started with Power BI series. Power BI is a powerful reporting and dashboarding tool; in which, organizations of all sizes can leverage to tell their data story. This series walks through the creation of building out a social media dashboard.

For Part 3, we will briefly touch on the visualizations, model editing, and creating a calculated measure.

Creating graphs and charts

 

After following the steps from Getting Started with Power BI Part 2: Getting Data of this series, we will end up back in Power BI Desktop with our list of fields and selection of visualizations on the right.

GettingStartedWithPowerBI_03_BuildingGraphs_01

Prepackaged and import charts

Looking at the “Visualizations” section, the following charts are included prepackaged inside of PowerBI. You will be able to see the various charts and graphs already included by hovering over the icons and reading the tooltip. Your list will, at least, include the following options:

  • stack bar/column charts,
  • clustered bar/column charts,
  • 100% stack bar/column charts,
  • line chart,
  • area chart,
  • stacked area chart,
  • line & stack column chart,
  • line & clustered column chart,
  • waterfall chart,
  • scatter chart,
  • pie chart,
  • tree map,
  • map,
  • table,
  • matrix,
  • filled map,
  • funnel,
  • gauge,
  • cards,
  • kpi,
  • slicers,
  • donut chart,
  • R – studio (enter R code),
  • Or you may Import other charts created, by people in the community, from the visual gallery https://app.powerbi.com/visuals/ .

 

Let’s see how many likes we have.  To get a basic total, let’s add a single card and select the LikesCnt checkbox.

GettingStartedWithPowerBI_03_BuildingGraphs_02

I’m not a fan of the text title, so we have two options.

  1. We could rename the column. By clicking on the ellipse to the right of the name, there you are given some options, one of which is to rename the column.

GettingStartedWithPowerBI_03_BuildingGraphs_03

2. We could reformat the card by clicking on the paint brush icon.

GettingStartedWithPowerBI_03_BuildingGraphs_04

By turning off the Category Label, and adding a Title instead. I’ve also changed the default color of the text, alignment and font size.

GettingStartedWithPowerBI_03_BuildingGraphs_05

Adding a Measure

I’m now curious, what is my “like” ratio compare to my post count? On the left, you will notice Power BI separating the Report, Data, and Relationship. By clicking on the Data (table icon), we can do more manipulation of the data.

GettingStartedWithPowerBI_03_BuildingGraphs_06

You will be brought to a table-excel like version of all the data. To calculate the ratio, I will need to add a new Measure. Click on the “New Measure” icon on the right.

GettingStartedWithPowerBI_03_BuildingGraphs_07

I’m going to call and define my new measure as:

GettingStartedWithPowerBI_03_BuildingGraphs_08

This will add a new field that can be seen on the visual editor, but first we have to fix another issue for this measure to work correctly.

Modeling

The LikesCnt and CommentCnt are seen as Text and should be numbers, especially if we want our new Measure to work.

GettingStartedWithPowerBI_03_BuildingGraphs_09

Just go to the modeling tab.

GettingStartedWithPowerBI_03_BuildingGraphs_10

There you can change the Data Type to Whole Number for both columns. A warning should pop-up stating that changing the data type will change how the data is stored.

GettingStartedWithPowerBI_03_BuildingGraphs_11

Now going back to the visual designer, you should now see the new measure in the fields list.

GettingStartedWithPowerBI_03_BuildingGraphs_12

Now, selecting that field, you will see in the Modeling tab, this field is being formatted as text, just change Text to Decimal with 1 or 2 decimal places.

GettingStartedWithPowerBI_03_BuildingGraphs_13

Now reset or recreate the card to use the ratio and any other formatting and style you may want on that card.

GettingStartedWithPowerBI_03_BuildingGraphs_14

In Part 3, we briefly went over simple styling and editing, basic model edits of the data and creating a simple measure using Data Analysis Expressions (DAX). If you want more than a very basic touch on DAX, I would suggest checking out this Data Analysis Expressions (DAX) Reference article to learn more about other DAX concepts and formulas.