Tutorial Lesson 01
Tutorial Lesson 01
Content
Important notes: / / / / / / / / / / / / / / / / / / / 2
Excel vs Power BI / / / / / / / / / / / / / / / / / / 5
Phase 1: Extract/ / / / / / / / / / / / / / / / / / / / 7
Phase 2: Transform / / / / / / / / / / / / / / / / / / 17
Phase 4: Calculation / / / / / / / / / / / / / / / / / / 20
Phase 5: Visuals / / / / / / / / / / / / / / / / / / / / 22
Recommendations/ / / / / / / / / / / / / / / / / / 22
1
POWER BI WEEK – SALES DASHBOARD
Hey guys!
I’m glad to have you here with me! This is the first edition in English besides
the others 4 in Portuguese. All students that took these lessons are now building
dashboards like a Pro with Power BI. You are next!!
Let me know where you are from!! Write in the chat. Also, tag me in your stories
in Instagram so I can share with my connections.
First of all, I’m Leonardo Karpinski and I like to teach Power BI with flowered
shirts! LOL It’s my trademark!
I already helped more than 16 thousand of people, and I’m here to help you as
well!
Okay, let me show you what we are going to learn during this week. We are going
to build a dynamic and interactive Sales and Financial Dashboard from scratch! That’s
right!
Important notes:
- We will have five lessons, one for each day until Friday at the same time (Brazil
12pm – UTC 3pm – India 8:30pm);
- From today (Monday) to Thursday, the sessions will be recorded, but I will be
live in the chat during the session;
- The database and materials for today are available in the link in the description;
- In the materials there is also a complete PDF tutorial for every single step I’m
going to present here;
- Pay attention here first, then later you can practice. You will have the video and
2
POWER BI WEEK – SALES DASHBOARD
- I will provide my solution in Power BI (PBIX file) for those who watch Live on
Thursday;
- And last but not least, pretend you paid a large amount of money to participate
in this event, and be committed during this week! I’m pretty sure it will be life-
changing to you!!
Now, I want to know the experience you guys have with Power BI:
2) Beginner
3) Intermediate
4) Expert
If you never used, congrats for being here! You are starting a very promising
career that is growing more and more.
There are no restrictions. All you need is data. I showed some dashboards
for Sales, HR, Sales vs Target, and Logistics. You can see that we have an overall
information and detailed information in the same dashboard, and also make
simulations!
3
POWER BI WEEK – SALES DASHBOARD
4
POWER BI WEEK – SALES DASHBOARD
With a Pro license ($9.90 month/user) when you need to share reports on the
cloud in a safe way.
FYI: Power BI Service, Cloud and Online are all the same, okay?
or publishing as public. This way anybody can access the information for free (not
really a safe way).
Excel vs Power BI
A really common doubt, right? Both tools are really good for different purposes.
Excel is a report-based tool. Simple to use but too many “copy and paste” techniques.
Power BI is a model-based tool that you can create reports on top of data model.
Once the model is defined, you can build different reports with the same data. You
automate processes.
5
POWER BI WEEK – SALES DASHBOARD
2) Transformation
5) Visualization
6) Distribution (publishing)
7) Automation
- Steps 6 and 7 are related to the Power BI Service and I recommend you read the
following blogpost:
https://powerbiexperience.com/en/definitive-guide-power-bi-licensing-free-x-
pro-x-a1-x-em1-x-p1/
6
POWER BI WEEK – SALES DASHBOARD
Report
Data
Model
Phase 1: Extract
Where does data come from?
The data we use in Power BI, usually comes from a database (OLTP database or
database transaction). A database is an organizational collection of data, usually stored
and accessible electronically from a computer system. When databases are more
overly complex, they are often built using a formal design and modeling method.
How do you get the data you work with today? Answer me in the chat:
7
POWER BI WEEK – SALES DASHBOARD
So, the first thing to do is to extract the data, just like we did in the video with
our Revenue data. Once extracted, we must transform data (always, always, always
transform before load).
When you click in “Transform data”, it will open a new window, that is the Power
Query Editor.
All the information you see in the formula bar is called “M”. We do not need to
worry about it now.
The best option, in my opinion, to remove empty rows, is to filter the column.
In the example was used the “Order Number” column. When you are going to do
this, you have to be sure about the column information, like this one that has to have
an order number value.
8
POWER BI WEEK – SALES DASHBOARD
9
POWER BI WEEK – SALES DASHBOARD
10
POWER BI WEEK – SALES DASHBOARD
You have to be careful because Power BI sometimes applies changes that were
no required. Like for example, the date configuration in Brazil we use dd/mm/yr in the
US mm/dd/yr, also the decimal separation with “ , ” or “ . ”. You can configurate per
locate:
Once you did all the transformation you needed, then click on “Close and Apply”.
Now we can start to build our dashboard!!
Let’s start comparing the Sales Amount. To select the table, you want to work
with, you can drag and drop in “Fields” or just check the box.
TIP:
When you create graph and you want to create another one, pay attention
to click outside the graph, otherwise you are going to change it instead of
creating a new one.
11
POWER BI WEEK – SALES DASHBOARD
When we use a clustered bar chart, when you click on the options it changes
according to your selection, see:
12
POWER BI WEEK – SALES DASHBOARD
Any changes you want to make, you have to use the “Format”.
When you save the file and find it in a folder, you can compare the size of your
file between Power BI and Excel.
Tell me, if you had an Excel with two files, you would have to use the functions
“VLOOKUP” and “XLOOKUP”, but in Power BI is different, is all about modelling,
creating relationships between them.
And the fact tables that usually have lots of rows and less columns, just like in the
example in the video.
The “Extract” function is to keep the data you want. Then click on “Text After
Delimiter”, which in this case is after the space.
Inside the “Delimiter” blank you click on the space bar, and “ok”.
13
POWER BI WEEK – SALES DASHBOARD
14
POWER BI WEEK – SALES DASHBOARD
That leaves us with two tables, “Product” and “Revenue”, and I want to compare
Sales Amount with Group.
Choose the “Table Chart”, then select “Group” and “Sales Amount”. Remember
you can configurate in “Format”.
It was only possible to make this work because of the relationship that Power BI
creates between the tables, since they have a column in common.
15
POWER BI WEEK – SALES DASHBOARD
You can see that when the relationship is deleted, it reflects directly in the chart.
Understanding 1: many
1 stands to one particularly value in the unique table (Product ID), and the “ * ”
for the value that is repeated.
Figure 19: 1: M
16
POWER BI WEEK – SALES DASHBOARD
Phase 2: Transform
What is the correct structure of a table?
- Whenever we connect to a data source and to use data, usually it is very we can
say “raw” because there are a lot of information that may or may not need, structured
or not, so we have always to prep them using Power Query, that we can call a “magic
box” since it’s where we structure and “clean” (transform) our data.
Power Query is our best friend for this. It is the tool to prepare, transform and
put the data into the right shape
Even better: you do this only once because it automates all your ETL process.
Since the structure remains the same, you won’t need to do it all over again.
In order to create a new column, you can right-click on any column and add a
“New Column”.
17
POWER BI WEEK – SALES DASHBOARD
18
POWER BI WEEK – SALES DASHBOARD
After doing so, you can see that in “Fields” there is a calculator in the “Revenue”.
TIP:
TRY TO AVOID USING IMPLICIT MEASURE.
19
POWER BI WEEK – SALES DASHBOARD
Per what you could see in the video, there are 2 measures: implicit and explicit. I
will give you 3 reasons why the explicit measure is better.
• You must always use a measure instead of a column when you use Values;
Today we are going to skip the Modeling phase and talk about it tomorrow.
Phase 4: Calculation
- DAX: Data Analysis eXpressions;
- Filter Context: is the combination of all filters that are applied on the report,
which propagate through the relationships. Doesn’t iterate, but filters;
- CALCULATE function: it is the only function that can modify the evaluation
context;
1) Columns: consume memory and are static calculations. Use only for
information on the Axis or for Filters.
2) Measures: are dynamic and consume only CPU, because they are calculated
on the fly. Use always for Math (numbers that you place in the Values of the visuals);
20
POWER BI WEEK – SALES DASHBOARD
COST =
SUMX (
REVENUE,
REVENUE[QTY ITEMS]
* RELATED ( ‘PRODUCT’[UNIT COST] )
)
To calculate the Gross Margin in this case is easy to calculate since is Revenue –
Cost.
Whenever I must divide two measures, I prefer to use the function “DIVIDE”:
21
POWER BI WEEK – SALES DASHBOARD
Phase 5: Visuals
What is Data Storytelling?
The main idea of dashboards is they must give the answer is been looked for just
by looking at the analysis, without explaining or any question. It must always be easy
to understand.
The power of building a narrative around a set of data to help convey the
meaning of that data in a powerful and compelling fashion
TIP:
HTTPS://TDWI.ORG/PORTALS/WHAT-IS-DATA-STORYTELLING-
DEFINITION.ASPX
And what is NOT Data Storytelling? See examples of what not to do here: https://
viz.wtf/
Recommendations
1) Be concerned about design – really important!! This is the first thing
people see in your dashboards.
2) Identify your audience – Once you do that, you will have a better idea to:
- Ask how a dashboard will be used and design for next step actions.
- How much detail does the reader need? You must pay attention to this
one because you will have to change information depending on whom you are going
22
POWER BI WEEK – SALES DASHBOARD
to send to and what are the most important information one needs.
3) Draw a sketch*
- Good design should tell a story with data that does not become
overwhelming with way too much information, clutter, or noise.
- If detail tables are needed, place them on the bottom of the dashboard
4) Choose the right theme and keep consistency. This way the user automatically
associates the color with the information in any other moment of the dashboards.
An important tip for you: whenever you need to compare values that change over
time, use it in a horizontal, this means time in x-axis.
When you have a category that you want to compare, we use it in the y-axis.
23
POWER BI WEEK – SALES DASHBOARD
Tip: * whenever you are building a dashboard, star from the upper bottom and
make it in a “Z” field of vision
Tip: ** Use columns charts for time and bars for categories.
In the “Assets” folder I have provided as a bonus some backgrounds. Use it wisely!
😊 And sure, make the changes you feel appropriates.
Keep in mind that must maintain the same colors for the same subject.
24
POWER BI WEEK – SALES DASHBOARD
Tool bar – “View” – Choose the theme you think it’s more appropriate for your
information.
25
POWER BI WEEK – SALES DASHBOARD
While I’m building the dashboard, I’m not liking the layout with too many
measures. So, I’m going to create a table to put all measures in the same table.
“Home” tab → “Enter data” → “Create Table” → “Load” → Name the table
Then you will be able to see the table in “Fields”. Select all the measures, drag
and drop to the measures folder.
26
POWER BI WEEK – SALES DASHBOARD
3. Using DAX
DATE = CALENDARAUTO()
Then go to your relationship environment to see if the Date Table was created
and then create a new relationship. In this case is going to be a little more complicated
since there are two date options “Due Date” and “Order Date”.
For our dashboard, since is a Sales Report and I want finance information, it’s
better that we use “Due Date”.
Drag and drop and check to see if the relationship was made correctly.
We can see that we cannot almost read the months, right? Let me give you a tip:
27
POWER BI WEEK – SALES DASHBOARD
MONTHNO = MONTH(‘DATE’[DATE])
28
POWER BI WEEK – SALES DASHBOARD
Now that the “MonthNo” was created you can drag and drop it directly in “Axis”.
Copy the “Operational Revenue – Card” → Open “Filters” → “Filter type” as “Top
N” Inform how many Top N you want (in the example was 1) .
29
POWER BI WEEK – SALES DASHBOARD
Then add "Slicer" in “Visualizations”. After the first one, just copy and paste the
others.
30
POWER BI WEEK – SALES DASHBOARD
That is it for today, guys! We learned a lot of new things today, huh?!
It’s crucial that you practice and think how to solve problems.
So, import all the tables, create your own version, and post the result on
LinkedIn mentioning me and using the hashtag #PowerBIWeek.
Thanks for attending Power BI Week! Don't forget you still have more, huh?!
See you!
Cheers,
Leonardo Karpinski.
31
POWER BI WEEK – SALES DASHBOARD
32