0% found this document useful (0 votes)
93 views

Power BI Practice

The document outlines a lab session to teach Power BI. It covers loading and relating data, creating visualizations, data transformations with Power Query and calculations with DAX, interactive filtering with slicers, and advanced DAX calculations across tables.

Uploaded by

azizmustafan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
93 views

Power BI Practice

The document outlines a lab session to teach Power BI. It covers loading and relating data, creating visualizations, data transformations with Power Query and calculations with DAX, interactive filtering with slicers, and advanced DAX calculations across tables.

Uploaded by

azizmustafan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Lab Session

Part 1: Getting Started with Power BI

• Introduction to Power BI Interface:

1. Open Power BI Desktop.

2. Explore the three main views: Report, Data, and Model views.

• Loading the Data:

1. Click "Get Data" > "Excel".

2. Navigate to and select the saved Excel file with the Swedish sales data.

3. Check the box for both the 'Sales' and 'Products' tabs then click "Load" to
import them into the Power BI model.

Part 2: Understanding and Managing Relationships

• Exploring Data Tables:

1. In the "Data" view, examine both tables to ensure all columns and data types
are correctly interpreted.

2. Identify the common column ('Product_ID') that will be used to relate the
tables.

• Creating Relationships:

1. Switch to the "Model" view.

2. Drag the 'Product_ID' field from the 'Sales' table to the 'Product_ID' field in the
'Products' table to create a relationship.

3. Double-click the relationship line to verify it is set to ‘many-to-one’


cardinality, and the cross filter direction is set to 'Both'.

Part 3: Creating Visualizations

• Clustered Column Chart for Monthly Sales:


1. Use "Clustered Column Chart".

2. Place "Date" on the Axis and "Total Sales" measure on the Values.

• Waterfall Chart for Monthly Sales Variance:

1. Select "Waterfall Chart".

2. Use "Date" for Category and "Total Sales" for Y Axis.

• Treemap for Product Category Breakdown:

1. Choose "Treemap".

2. Use "Product_Category" for Group and "Total Sales" for Values.

• Funnel Chart for Sales Pipeline:

1. Insert "Funnel" visualization.

2. Use "Product_Category" for Group and "Total Sales" for Values.

• Scatter Chart for Price vs. Quantity:

1. Select "Scatter Chart".

2. Drag "Unit_Price" to the X-Axis, "Quantity" to the Y-Axis, and "Total Sales"
to the Size.

• Heat Map for Sales by City and Product Category:

1. Find and add a "Heat Map" visual from the Marketplace, if available.

2. Use "City" for Rows, "Product_Category" for Columns, and "Total Sales" for
Values.

• Map Visualization for Sales by City:

1. Use "Map" or "Filled Map" to visualize sales by location.

Part 4: Data Transformation and DAX

• Using Power Query Editor for Data Transformation:

1. Open the Power Query Editor to review if any data transformation is needed.
• Creating Calculated Columns with DAX:

1. Add a "Total Cost" column with the formula: Total Cost = [Quantity] *
[Unit_Price].

2. Create a "Profit" column with the formula: Profit = [Sales] - [Total Cost].

• Introducing Measures with DAX:

1. Create a "Total Sales" measure with the formula: Total Sales =


SUM(Sales[Sales]).

2. Develop an "Average Unit Price" measure with the formula: Average Unit
Price = AVERAGE(Sales[Unit_Price]).

• Time Intelligence with DAX:

1. Construct a "Sales LY" measure with the formula: Sales LY =


CALCULATE([Total Sales], SAMEPERIODLASTYEAR(Sales[Date])).

2. Compute "YoY Growth" with the formula: YoY Growth = ([Total Sales] -
[Sales LY]) / [Sales LY].

• Using DAX for Advanced Calculations:

1. Show total sales for only a specific city using "CALCULATE".

2. Rank cities by sales with "RANKX" using the formula: City Rank by Sales =
RANKX(ALL(Sales[City]), [Total Sales], , DESC).

Part 5: Interactivity and Design

• Adding Slicers for Interactive Filtering:

1. Add slicers for "City" and "Date".

• Formatting Visualizations:

1. Customize visuals using the "Format" pane.

Creating Visualizations with Related Data:

• Pie Chart for Sales by Product Type:


1. Insert a "Pie Chart".

2. Use "Products[Product_Category]" from the related 'Products' table for


Legend.

3. Use the "Total Sales" measure for Values.

• Bar Chart for Top 5 Products by Sales:

1. Select a "Stacked Bar Chart".

2. Place "Products[Product_Name]" onto the Axis.

3. Use "Total Sales" measure for Values and apply a visual filter to show the top
5 products by sales using the "Top N" filter option.

• Combination Chart for Sales and Quantity Over Time:

1. Select the "Line and Stacked Column Chart".

2. Place "Date" on the shared Axis.

3. Use "Total Sales" and "Total Quantity Sold" measures for Values, assigning
sales to column values and quantity to line values.

DAX Calculations Across Tables:

• Creating a Related Measure for Average Price by Product Type:

1. Create a new measure: Average Price by Type =


AVERAGEX(RELATEDTABLE('Products'), 'Products[Unit_Price]').

• Product Count by Category:

1. Develop a measure: Product Count by Category =


CALCULATE(DISTINCTCOUNT('Products[Product_ID]'),
REMOVEFILTERS('Sales')).

The session aims to build a solid foundation while challenging to explore the depth of Power
BI's capabilities.

Thank You!

You might also like