3 Data Visualization With PowerBI
3 Data Visualization With PowerBI
Power BI is a business intelligence tool that allows you to connect to various data
sources, visualize the data in reports and dashboards, and then share them with
anyone you want.
Here, you can also choose whether to load the data directly or go straight to
the Power Query Editor using the Transform Data option. Transforming your
data before loading it in can be advantageous, as there are often small
errors and issues that you may want to iron out first. Select Transform Data,
and a separate window will open up for the Power Query Editor.
Power Query
The Power Query Editor can be broken up into 4 main parts:
Removing rows and/or columns - some Excel data can have a lot
of blank rows and/or columns inserted for readability and aesthetic
purposes, but these are not useful in Power BI and should be
removed.
Changing data types - data types such as number, date, or text
should be specified for each column. Power BI will try to
automatically detect the data type, yet it can sometimes be wrong
or there can be errors so it is a good idea to always double-check
the data types.
Combining data with merge and append - similar to join and
concatenate in SQL, these transformations allow you to combine
queries from multiple sources.
Pivot and unpivot - these options allow you to transform your data
from a wide to a long format and vice versa. The unpivot option is
particularly useful when dealing with Excel files that have
information (such as dates) running across the columns of a table
rather than as rows.
Adding a conditional column - this is a useful transformation that
allows you to add a column based on if/then/else logic.
In the example below, we have included an additional table
called Products containing some fictitious product categories to demonstrate
data modeling later in this tutorial. You can add this table by selecting Enter
Data in the ribbon.
Lastly, select Close & Apply from the ribbon to start building and designing
the report.
1. Select a field from a table and drag it onto the field in the second
table with which you want the relationship to form.
2. Select Manage Relationships from the ribbon and then select New to
add a relationship using the same window we will discuss next
(except that it will start as "blank").
By default, Power BI will try to infer a relationship between tables. It doesn't
always get this right, so you may wish to turn this feature off in the settings.
To edit the relationship, right-click the connecting line between them and
select Properties.
Visualizations
There are a variety of visualizations available in Power BI—bar charts, line
charts, pie charts, tables, matrices, simple cards, KPIs, gauges, interactive
maps, and much more. On top of that, there are many formatting options
that you can play around with, too.
You can also import custom visualizations if your desired visual is not on the
list. Simply click the ellipsis, and a window will pop up where you can browse
all the available visuals—this is known as Microsoft AppSource. You can
even design your own visuals if you have programming experience.
Since the profit margin is negative for one of the segments, we will add some
conditional formatting to make that negative value stand out.
Select the formatting icon at the top of the visualization pane and then go
down to the Bars options. Here, we can change the colors of the bars. To
apply conditional formatting, select the fx symbol, and a window will pop up
where you can apply rules based on the value of any field. Here, we select
the Profit margin field and specify that the color should be "red" if the
number is less than 0.
KPI visual
To insert a KPI visual, select the icon in the visualization pane. A blank KPI
visual will appear on the canvas. This KPI will be based on the Profit
margin measure that we created earlier. Drag the Profit margin field to Value.
Next, we will add a target of 20% for the KPI. We could add the target by
dragging a measure field under the Target value (this is useful if the profit
margin target is used in other visuals), but we will instead select the
formatting icon and enter the target value under the Gauge axis section.
Publishing Reports to Power BI Service
Once you are happy with your report, you can publish it to your Power BI
Workspace. To do this, you must sign in to Power BI and then
select Publish from the ribbon. Select a workspace, and the report will be
published to Power BI Service. Log in to your Power BI account and
navigate to the workspace where you published your report.
Data
Publishing a report also publishes the data, which you will see separately in
your workspace. You can use this data to create new reports from the Power
BI Service. Whenever you republish a report, the data will be overwritten, so
watch out for any changes to the data that could break the reports created
from this data in the Power BI Service.
Select the data, and you will be brought to a screen where you can see an
overview of all the reports that were built using this dataset. From this
screen, you can also create a report using this data or share this data with
others. If you have a Power BI Gateway set up, you can also refresh the data
either manually or on a schedule.
Report
Go back to your workspace and now select the report. From here, you can
view and interact with the report as well as do a few other useful things,
such as:
Export the report as an Excel, PowerPoint, or PDF file for your own
data analysis or presentation.
Share the report with other people.
Subscribe to the report to receive emails on a schedule or when the
report is refreshed.
Each visual also has a number of options:
Dashboard
You can pin entire reports or individual visuals to dashboards. The biggest
benefit of using dashboards is that they allow you to pin visuals from
different reports in your workspace. This way, you can easily keep track of
important metrics in one place rather than clicking on each report to see
them.
Conclusion
Power BI is a powerful tool for transforming data into actionable insights
through interactive dashboards and reports. Whether you're just getting
started or looking to deepen your expertise, learning Power BI is a valuable
step for anyone in data analytics or business intelligence.