Professional Documents
Culture Documents
Powerbi: Index
Powerbi: Index
Course https://www.udemy.com/course/mspowerbi/learn/lecture/20493818#overview
Material https://www.superdatascience.com/pages/powerbi
Index
Section 1
• Connect to csv file and load data into PowerBI
• Drill down
• To add color by category
• Add a new column into dataset
• Adding Labels to chart
• Add title
• Change axis labels
• Set data type for column
• Visualize time series data
• Aggregation and granularity
• Convert a line chart into an area chart
• Filters and slicers
Section 4
• Create relationship between two tables
• Types of joins
• Joins with duplicate values
• Joining on multiple fields
• Creating a map with hierarchies, lat and long
• Calculated columns vs calculated measures
• Creating a scatter plot
• Combing charts, filters and slices
• Adding a doughnut chart
Section 1
Books Page 1
• Getdata > CSV
Books Page 2
•
• You will now see your fields in the right hand corner
Books Page 3
•
• You can always click on the data tab on the left to change the data type of the dataset if
required
• 2 other tabs on the right are: Report and Relationship
• You can also access other types of data like SQL, XML, Json and many other types of data
Navigation Bar
• Home:
○ Refresh: Refresh the data
• Insert:
○ New Page: to insert a new page, you can also do that from the tabs on the bottom or
delete page from there
Books Page 4
•
Visualizations
• Drag two columns onto the plain white space.
• By default they will create a table visualization
• You can convert this into other types of visuals like barchart from the options available on the
right
Books Page 5
•
• Also have many other types like area chart, pie/doughnut chart, waterfall chart etc
• Ctrl + S- save
• Drill down
• Can drill down into sub categories in your data
Books Page 6
•
• If we look at option switch to next level from year it goes down to quarter
• But here it shows and arranges the data only basis the level currently specified disregards the
higher levels
• So this is an aggregate of all Q1 in 1st Q2 in second etc, but could be in the wrong order as at
this level disregarding the year value ( in this example 2014 had Q3, Q4 data and 2015 had
Q1,Q2 data)
Books Page 7
•
• Adding colors
• Requirement: Show num of units sold by all the representatives and the region they belong to.
The Rep will be in the x-axis as bar chart and the colours of the bars will represent the region
they belong to
• Step 1: Plot a bar chart with Units and rep
Books Page 8
•
• NOTE: Sorting here depends on the order in which you added column to the axis option in
visualization tab
• So if you dragged Region first to will sort by region if rep it will sort by rep to change the order
clear the field and add in the order you want to sort
• To add color by category
• Drag category you want to color code into the Legend option in visualization tab
Books Page 9
•
• This chart is showing total number of units sold but we need to find out the $ value of total
sales from each rep
• Add a new column into dataset
• Fields > right click > new column
Books Page 10
•
• Can verify new column is added in the data tab on the left
• Now replace Units with Tot_Sales in values option of visualization tab on the right
• SOLUTION: Whoever has made the max sales in each region will get the bonus
• Hence Mathew, Susan and James will get the bonus
Books Page 11
•
Books Page 12
•
Books Page 13
•
• Add title
• Format > Title
Books Page 14
•
Books Page 15
• Select the column, goto column >Formatting > Format
QUIZ
Books Page 16
•
Books Page 17
•
• We need to drill down on this time series data and assess if there are any patterns emerging
• If press drill down it just shows specific individual level but does not give a birds eye view
• If we use Switch to next level it becomes a categorial classification at a particular level and
disregards the higher levels
Books Page 18
○
Books Page 19
•
• There is seasonality. Can observe the same if we drill down into the months as well
• Lets go back to top level and use expand next level instead
• This preserves the hierarchy and shows both the year data as 4 separate points.
Books Page 20
•
• Now we can really track how the total unemployment has varied over time
• So this increased the points on your timeline
• This graph is technically an aggregation of 2 lines (1 for male other female) but nowhere have
we specified that we need that separate level of detail in the visual
• So to get 2 separate lines take gender and put it into the legend option
Books Page 21
•
• It is a bit clustered and hard to read so you can convert into a stacked area chart
Books Page 22
• It is a bit clustered and hard to read so you can convert into a stacked area chart
• What if we wanted same visual but only with the data for male gender
• Can add a filter
• Drag gender field to filter and pick only men
Books Page 23
•
• Now we can look at adding a slicer (make a duplicate of the existing sheet so you can always
revert back to it if the new visual doesn’t work)
• Add a slicer as a new visual. Slicers make the filtering of data easier.
Books Page 24
•
Books Page 25
•
QUIZ
Books Page 26
•
Books Page 27
•
• You can press autodetect to find potential relationships when you update the table
• You can also manually create or edit existing relationships
Types of joins
Books Page 28
• Which employees are also customers?
• Left outer join: No records are discarded from the primary table (here left table) only from the
child table, if no match then those columns are left blank
Books Page 29
•
Books Page 30
•
• Need to link the table with both columns Store and Order # (order # are unique for each store)
• Need to create a hierarchy (country, state, city, then lattitude and longitude)
• To do this create hierarchy for country field and add the other fields to this new hierarchy
Books Page 31
• To do this create hierarchy for country field and add the other fields to this new hierarchy
• Rename Geography
• Note if you drill down to the city you will notice it includes some locations in US. That's
because there are cities with the same name in multiple countries and drill down ignores the
data in higher levels.
Books Page 32
•
• But lat and long are given for each order and at a country level it ends up taking the average
Books Page 33
Calculated columns vs calculated measures
• We want calculate the profit margin (profit/sales)
• Cal columns are calculated before aggregation and cal measures are done after aggregation
• Cal measures are calculated on the fly/dynamically when you render the visualization unlike
cal columns which are stored in the table
• Create a calculated measure
○ Right click > New measure
○
○ Remember columns used must be aggregated
○ Put color saturation
Books Page 34
○
Books Page 35
•
• Only 1 dot as you have not specified the level of aggregation, for which you will need to
specify some categorical or non numeric variables
• But it doesn’t add a lot of value analyzing regionwise instead look at which customers are the
most profitable
• So use customer name as details
Books Page 36
•
Books Page 37
• Drag and drop field > select advanced filtering
Books Page 38
○
○ You can also add background or borders to make the buttons more visible
• You can also disable the header for the slicer
Books Page 39
○
Quiz
Books Page 40
•
Books Page 41
•
• In case it is still not recognized, select the field and go to column tools > data category > state
or province
Books Page 42
• To prevent automatic resizing
○ The count of customers will be displayed dynamically based on the region selected
Books Page 43
•
Books Page 44
•
Books Page 45
•
Create a treemap
• Similar to pie chart
• When you have a lot of different categories a pie chart can get overwhelming and the breakup
is less evident
• Can set to display the % of grand total
Creating a dashboard
• Copy and paste all your charts onto a new sheet
Books Page 46
• Copy and paste all your charts onto a new sheet
• You can also add gridlines and snap to grid for easy formatting. Mobile layout option is also
available
• Set intuitive titles
Books Page 47
•
• You have 3 options for how a chart can react to selection: filter, highlight or none
• If you select filter it will no longer have that underlay of the total data
Analysing results
Books Page 48
•
• For England there is a sudden dip in the bank balance is that because people in that income
category prefer banking with competitors
○ It is reasonable to make this type of assumption if you have a lot of data points but if
you have very few customers in this segment then there is a chance that the dip or
deviation is just due to noise
Quiz
Books Page 49
•
Books Page 50