
This Project Case is part of the Microsoft Power BI Desktop for Business Intelligence Course on Udemy online platform by Maven Analytics. In this case, I am being put in the point of view of a Business Intelligence Analyst in AdventureWorks, a global manufacturing company that runs cycling equipment and accessories production. The Management Team needs a way to track the KPI, monitor and compare the performance, and identify some insights, as well as high value customers.
Using the Power BI to:

There are 8 Datasets used in this project, i.e.:
1. Returns Dataset (AdventureWorks Returns Data.csv)
| Field Name | Data Type |
|---|---|
| ReturnDate | Date |
| TerritoryKey | Whole Number |
| ProductKey | Whole Number |
| ReturnQuantity | Whole Number |
2. Products Lookup Dataset (AdventureWorks Product Lookup.csv)
| Field Name | Data Type |
|---|---|
| ProductKey | Whole Number |
| ProductSubcategoryKey | Whole Number |
| ProductSKU | Text |
| ProductName | Text |
| ModelName | Text |
| ProductDescription | Text |
| ProductColor | Text |
| ProductStyle | Text |
| ProductCost | Fixed Decimal Number |
| ProductPrice | Fixed Decimal Number |
| SKU Type | Text |
| DiscountPrice | Fixed Decimal Number |
3. Product Category Lookup Dataset (AdventureWorks Product Categories Lookup.csv)
| Field Name | Data Type |
|---|---|
| ProductCategoryKey | Whole Number |
| CategoryName | Text |
4. Product Subcategory Lookup Dataset (AdventureWorks Product Subcategories Lookup.csv)
| Field Name | Data Type |
|---|---|
| ProductSubcategoryKey | Whole Number |
| SubcategoryName | Text |
| ProductCategoryKey | Whole Number |
5. Calendar Lookup Dataset (AdventureWorks Calendar Lookup.csv)
| Field Name | Data Type |
|---|---|
| Date | Date |
| Day Name | Text |
| Start of Week | Date |
| Start of Month | Date |
| Start of Quarter | Date |
| Month Name | Text |
| Month | Whole Number |
| Start of Year | Date |
| Year | Whole Number |
6. Customer Lookup Dataset (AdventureWorks Customer Lookup.csv)
| Field Name | Data Type |
|---|---|
| CustomerKey | Whole Number |
| Prefix | Text |
| FirstName | Text |
| LastName | Text |
| BirthDate | Date |
| MaritalStatus | Text |
| Gender | Text |
| EmailAddress | Text |
| AnnualIncome | Fixed Decimal Number |
| TotalChildren | Whole Number |
| EducationLevel | Text |
| Occupation | Text |
| HomeOwner | Text |
| FullName | Text |
| DomainName | Text |
7. Territory Lookup Dataset (AdventureWorks Territory Lookup.csv)
| Field Name | Data Type |
|---|---|
| SalesTerritoryKey | Whole Number |
| Region | Text |
| Country | Text |
| Continent | Text |
8. Sales Dataset (AdventureWorks Sales Data 2020.csv, AdventureWorks Sales Data 2021.csv, & AdventureWorks Sales Data 2022.csv)
| Field Name | Data Type |
|---|---|
| OrderDate | Date |
| StockDate | Date |
| OrderNumber | Text |
| ProductKey | Whole Number |
| CustomerKey | Whole Number |
| TerritoryKey | Whole Number |
| OrderLineItem | Whole Number |
| OrderQuantity | Whole Number |
There are several steps in this phase in order to connect and shape the Data used in this case.
1. Update Power BI options and settings by:

2. Connect to the AdventureWorks Customer Lookup csv file by:

3. Connect to the AdventureWorks Product Lookup csv file by:

4. Connect to the AdventureWorks Product Category Lookup csv file by:

5. Connect to the AdventureWorks Product Subcategory Lookup csv file by:

6. Connect to the AdventureWorks Territory Lookup csv file by:

7. Connect to the AdventureWorks Calendar Lookup csv file by:
“Day Name”, “Start of Week”, “Start of Month”, “Start of Quarter”, “Month Name”, “Month”, “Start of Year”, “Year”

8. Connect to the AdventureWorks Returns csv file by:

9. Connect to the AdventureWorks Sales Data by:

10. With the exception of the other three data tables (“Largest companies”, “Rolling Calendar”, “Product Category Sales”, disable “Include in Report Refresh”, then Close & Apply by:
There are several steps in this phase in order to build a Relational Model. These steps involves Tables from 2 different groups (Lookup Tables & Data Tables):
A. Lookup Tables:
Calendar Lookup, Customer Lookup, Product Category Lookup, Product Lookup, Product Subcategories Lookup, and Territory Lookup.
B. Data Tables:
Returns Data and Sales Data
Those steps are as follow:
1. In the MODEL view, arrange the tables so that the lookup tables are above the data tables by:
2. Confirm the following:
3. Hide all foreign keys in Return Data Table from Report View
4. In the DATA view, complete the following steps by:
All the steps above resulted in the following Relation Model:

There are 3 spots in which I worked to add Calculation Fields and DAX, i.e. the Data View, the Report View, and the Additional Tables for Metric Selection.
1. In the DATA view, add the following calculated columns by:
Day of Week = WEEKDAY('Calendar Lookup'[Date],2)
Is Weekend? = if('Calendar Lookup'[Day of Week]= 6 || 'Calendar Lookup'[Day of Week] = 7,"Weekend","Weekday")
SWITCH ('Calendar Lookup'[Month Name],
"January","1","February","2","March","3","April","4","May","5","June","6",
"July","7","August","8","September","9","October","10","November","11","December","12", "Others")
Month Short = UPPER(LEFT('Calendar Lookup'[Month Name],3))
The above 4 Calculated Fields were added into Calendar Lookup Table.
Birth Year = YEAR('Customer Lookup'[BirthDate])
Customer Full Name (CC) = 'Customer Lookup'[Prefix]&" "&'Customer Lookup'[FirstName]&" "&'Customer Lookup'[LastName]
Customer Priority = IF ('Customer Lookup'[Parent]="Yes" && 'Customer Lookup'[AnnualIncome]>100000,"Priority","Standard")
Education Category = SWITCH(
'Customer Lookup'[EducationLevel],
"High School","High School",
"Partial High School","High School",
"Bachelors","Undergrad",
"Partial College","Undergrad",
"Graduate"
)
Income Level = SWITCH (TRUE(),
'Customer Lookup'[AnnualIncome]>=150000,"Very High",
'Customer Lookup'[AnnualIncome]>=100000,"High",
'Customer Lookup'[AnnualIncome]>=50000,"Average",
"Low"
)
Parent = if('Customer Lookup'[TotalChildren]>0,"Yes","No")
The above 6 Calculated Fields were added into Customer Lookup Table.
Price Point = SWITCH(TRUE(),
'Product Lookup'[ProductPrice]>500,"High",
'Product Lookup'[ProductPrice]>100,"Mid-Range",
"Low"
)
SKU Category = LEFT('Product Lookup'[ProductSKU],SEARCH("-",'Product Lookup'[ProductSKU])-1)
The above 2 Calculated Fields were added into Product Lookup Table.
2. In the REPORT view, add the following measures (Assign to tables as you see fit, and use a matrix to match the “spot check” values) by:
Total Cost = SUMX('Sales Data','Sales Data'[OrderQuantity]*RELATED('Product Lookup'[ProductCost]))
Total Customer = DISTINCTCOUNT('Sales Data'[CustomerKey])
Total Order = DISTINCTCOUNT('Sales Data'[OrderNumber])
Total Revenue = SUMX('Sales Data','Sales Data'[OrderQuantity]*RELATED('Product Lookup'[ProductPrice]))
Total Profit = [Total Revenue]-[Total Cost]
Total Return = COUNT('Returns Data'[ReturnQuantity])
Weekend Orders = CALCULATE([Total Order],'Calendar Lookup'[Is Weekend?]="Weekend")
YTD Revenue = CALCULATE([Total Revenue],DATESYTD('Calendar Lookup'[Date]))
All Orders = CALCULATE([Total Order],ALL('Sales Data'))
All Returns = CALCULATE([Total Return],all('Returns Data'))
Average Retail Price = AVERAGE('Product Lookup'[ProductPrice])
Average Revenue Per Customer = DIVIDE([Total Revenue],[Total Customer])
Bike Returns = calculate([Total Return],'Product Category Lookup'[CategoryName]="Bikes")
Bike Return Rate = calculate([Return Rate],'Product Category Lookup'[CategoryName]="Bikes")
Bike Sales = CALCULATE([Quantity Sold],'Product Category Lookup'[CategoryName]="Bikes")
Bulk Order = CALCULATE([Total Order],'Sales Data'[OrderQuantity]>1)
Quantity Returned = SUM('Returns Data'[ReturnQuantity])
Quantity Sold = sum('Sales Data'[OrderQuantity])
Return Rate = DIVIDE([Quantity Returned],[Quantity Sold],"No Sales")
Returns Target = [Previous Month Returns]*1.1
Revenue Target = [Previous Month Revenue]*1.1
Revenue Target Gap = [Total Revenue]-[Revenue Target]
High Ticket Orders = CALCULATE([Total Order],
FILTER('Product Lookup','Product Lookup'[ProductPrice]>[Overall Average Price]))
Orders Target = [Previous Month Orders]*1.1
Order Target Gap = [Total Order] - [Orders Target]
Overall Average Price = CALCULATE([Average Retail Price],ALL('Product Lookup'))
Previous Month Orders = CALCULATE([Total Order],DATEADD('Calendar Lookup'[Date],-1,MONTH))
Previous Month Profit = CALCULATE([Total Profit],DATEADD('Calendar Lookup'[Date],-1,MONTH))
Previous Month Returns = CALCULATE([Total Return],DATEADD('Calendar Lookup'[Date],-1,MONTH))
Previous Month Revenue = CALCULATE([Total Revenue],DATEADD('Calendar Lookup'[Date],-1,MONTH))
Profit Target = [Previous Month Profit]*1.1
Profit Target Gap = [Total Profit]-[Profit Target]
P% of All Order = DIVIDE([Total Order],[All Orders])
% of All Returns = DIVIDE([Total Return],[All Returns])
10-Day-Rolling Revenue = CALCULATE(
[Total Revenue],DATESINPERIOD ('Calendar Lookup'[Date],MAX('Calendar Lookup'[Date]),-10,DAY))
90-Day-Rolling Profit = CALCULATE(
[Total Profit], DATESINPERIOD ('Calendar Lookup'[Date],MAX('Calendar Lookup'[Date]),-90,DAY))
Adjusted Price = [Average Retail Price]*(1 + 'Price Adjustment (%)'[Price Adjustment (%) Value])
Adjusted Profit = [Adjusted Revenue]-[Total Cost]
Adjusted Revenue = SUMX('Sales Data','Sales Data'[OrderQuantity]*[Adjusted Price])
3. In the Additional Tables for Metric Selection, add the following Measures by: There are 3 Additional Tables for Metric Selection, i.e.:
Customer Metric Selection = {
("Total Customer", NAMEOF('Measures Table'[Total Customer]), 0),
("Revenue Per Customer", NAMEOF('Measures Table'[Average Revenue Per Customer]), 1)}
Price Adjustment (%) = GENERATESERIES(-1, 1, 0.1)
Price Adjustment (%) Value = SELECTEDVALUE('Price Adjustment (%)'[Price Adjustment (%)], 0)
Product Metric Selection = {
("Order", NAMEOF('Measures Table'[Total Order]), 0),
("Revenue", NAMEOF('Measures Table'[Total Revenue]), 1),
("Profit", NAMEOF('Measures Table'[Total Profit]), 2),
("Return", NAMEOF('Measures Table'[Total Return]), 3),
("Return %", NAMEOF('Measures Table'[Return Rate]), 4)}
Executing all the detailed Steps in 3 spots above, resulted in adding 4 new Tables containing all Measures needed in the modelling.

The overall tables created the complete Relation Model for all the data loaded in the Power Bi

The report dashboard is to provide information as required in the Objectives Section. There are 8 pages in the dashboard, i.e.:
1. Executive Dashboard

2. Product Detail

3. Map

4. Customer Detail

5. Question & Answer (QnA)

6. Decomposition Tree

7. Key Influencer

8. Top Segmentation

As per defined in the Objectives section, the final goal of the project was to provide a dashboard that can be used to analyze several things.
The live report dashboard can be found here