Project-1 Updated
Project-1 Updated
INSTRUCTIONS
• You will be working through the entire business intelligence workflow: connecting and shaping the source
data, building a relational model, adding calculated columns and measures, and designing an
interactive report. I have attached all of the files you need to get started:
• Universal_Data.png (Universal Data logo)
• Universal_Data_CSV_Files.zip (zipped folder containing the 8 CSV files you'll need to build your report)
• In case you get stuck, I've also included a completed report (“Universal_Data_Report_Complete") for you to
reference along the way.
DATA ENGINEERING (SHAPING)
1) Update your Power BI options and settings as follows:
• Deselect the "Autodetect new relationships after data is loaded" option in the Data Load tab
• Make sure that Locale for import is set to "English (United States)" in the Regional Settings tab
Select "product_brand" and use the Group By option to calculate the average retail price by brand, and name the new column "Avg Retail
Price
• Add a calculated column named "discount_price", equal to 90% of the original retail price
• Format as a fixed decimal number, and then use the rounding tool to round to 2 digits
Ans: Custom column added and renamed as discount_Price
[product_retail_price]*90/100 used Rounding option for 2 Decimal
Replace "null" values with zeros in both the "recyclable" and "low-fat" columns
4) Connect to the UniversalData_Stores csv file
• Name the table "Stores" and make sure that headers have been promoted
• Confirm that data types are accurate (Note: "store_id" and "region_id" should be whole numbers)
• Add a calculated column named "full_address", by merging "store_city", "store_state", and "store_country", separated by a comma and
space (hint: use a custom separator)
Created Duplicate columns store city store state store country and merged all the columns with , as separator
5) Connect to the UniversalData_Regions csv file
• Name the table "Regions" and make sure that headers have been promoted
• Confirm that data types are accurate (Note: "region_id" should be whole numbers)
9) With the exception of the two data tables, disable "Include in Report Refresh", then Close & Apply
• Confirm that all 7 tables are now accessible within both the RELATIONSHIPS view and the DATA view
9) With the exception of the two data tables, disable "Include in Report Refresh", then Close & Apply
Right click on the Transaction_Data in queries and uncheck in include in report refresh
1) In the RELATIONSHIPS view, arrange your tables with the lookup tables above the data tables
• Connect Transaction_Data to Customers, Products, and Stores using valid primary/foreign keys
• Connect Transaction_Data to Calendar using both date fields, with an inactive "stock_date" relationship
• Connect Return_Data to Products, Calendar, and Stores using valid primary/foreign keys
• Connect Stores to Regions as a "snowflake" schema
3) Hide all foreign keys in both data tables from Report View, as well as "region_id" from the Stores table
4) In the DATA view, complete the following:
• Update all date fields (across all tables) to the “m/d/yyyy" format using the formatting tools in the Modeling tab
• Update "product_retail_price", "product_cost", and "discount_price" to Currency ($ English) format
• In the Customers table, categorize "customer_city" as City, "customer_postal_code" as Postal Code, and "customer_country"
as Country/Region
• In the Stores table, categorize "store_city" as City, "store_state" as State or Province, "store_country" as Country/Region, and
"full_address" as Address
In the date View made all the above changes and saved pbx File
DAX MEASURES
1) In the DATA view, add the following calculated columns:
• In the Calendar table, or Sundays (otherwise add a column named "Weekend"
• Equals "Y" for Saturdays "N")
DAX = Weekend = IF('Calendar'[Day Name] == "Sunday" || 'Calendar'[Day Name] == "Saturday", "Y", "N")
Years_Since_Remodel = DATEDIFF(Stores[last_remodel_date],TODAY(),YEAR)
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)
• Create new measures named "Quantity Sold" and "Quantity Returned" to calculate the sum of quantity from each data table
• Spot check: You should see total Quantity Sold = 833,489 and total Quantity Returned = 8,289
Return Rate = [Quantity Returned]/[Total Quantity Sold] ( Check Spot is not matching )
• Create a new measure named "Weekend Transactions" to calculate transactions on weekends
• Spot check: You should see 76,608 total weekend transactions
get the cost column from product to transactional data cost = RELATED(Products[product_cost])
Order Cost = 'Transactional Data'[quantity]*'Transactional Data'[cost]
Total cost = SUM('Transactional Data'[Order Cost])
• Create a new measure named "Total Profit" to calculate total revenue minus total cost, and format as $
• Spot check: You should see a total profit of $1,052,819
Total Profit = [Total Revenue]-[Total cost]
• Create a new measure to calculate "Profit Margin" by dividing total profit by total revenue calculate total revenue (format as %)
• Spot check: You should see an overall profit margin of 59.67%
• $Create a new measure named "YTD Revenue" to calculate year-to-date total revenue, and format as
• Spot check: Create a matrix with "Start of Month" on rows; you should see $872,924 in YTD Revenue in September 1998
YTD Revenue = CALCULATE(SUM('Transactional Data'[Revenue]),DATESYTD('Calendar'[date].[Year]))
• Create a new measure named "60-Day Revenue" to calculate a running revenue total over a 60-day period, and format as $
• Spot check: Create a matrix with "date" on rows; you should see $97,570 in 60-Day Revenue on 4/14/1997
Last 60 Days Revenue = VAR LAST_DATE= LASTDATE('Transactional Data'[stock_date])
RETURN
CALCULATE([Total Revenue],FILTER(ALL('Transactional Data'[stock_date]),[stock_date]> LAST_DATE -60 && 'Transactional
Data'[stock_date]<LAST_DATE))
•
• Create new measures named "Last Month Transactions", "Last Month Revenue", "Last Month Profit", and "Last Month
Returns"
• Spot check: Create a matrix with "Start of Month" on rows to confirm accuracy
Last month transactions = CALCULATE([Total trasnsactions], PREVIOUSMONTH('Calendar'[date]))
Last month revenue = CALCULATE([Total Revenue], PREVIOUSMONTH('Calendar'[date]))
Last Month Profit = CALCULATE([Total Profit], PREVIOUSMONTH('Calendar'[date]))
• Create a new measure named "Revenue Target" based on a 5% lift over the previous month revenue, and format as $
• Spot check: You should see a Revenue Target of $99,223 in March 1998
Revenue Target = CALCULATE([Last month revenue]*5/100+[Last month revenue])
BUILDING THE REPORT
1) Rename the tab "Topline Performance" and insert the universal data logo
2) Insert a Matrix visual to show Total Transactions, Total Profit, Profit Margin, and Return Rate by Product_Brand (on rows)
• Add conditional formatting to show data bars on the Total Transactions column, and color scales on Profit Margin (White to Green)
and Return Rate (White to Red)
• Add a visual level Top N filter to only show the top 30 product brands, then sort descending by Total Transactions
3) Add a KPI Card to show Total Transactions, with Start of Month as the trend axis and Last Month Transactions as the target
goal
• Update the title to "Current Month Transactions", and format as you see fit
• Create two more copies: one for Total Profit (vs. Last month Profit) and one for Total Returns (vs. Last Month Returns)
• Make sure to update titles, and change the Returns chart to color coding to "Low is Good"
2) Insert a Matrix visual to show Total Transactions, Total Profit, Profit Margin, and Return Rate by Product_Brand (on rows)
• Add conditional formatting to show data bars on the Total Transactions column, and color scales on Profit Margin (White to Green)
and Return Rate (White to Red)
• Add a visual level Top N filter to only show the top 30 product brands, then sort descending by Total Transactions
•
5) Next to the map, add a Treemap visual to break down Total Transactions by store country
• Pull in store_state and store_city beneath store_country in the "Group" field to enable drill-up and drill-down functionality
6) Beneath the map, add a Column Chart to show Total Revenue by week, and format as you see fit
• Add a report level filter to only show data for 1998
• Update the title to "Weekly Revenue Trending"
7) In the lower right, add a Gauge Chart to show Total Revenue against Revenue Target (as either "target value" or "maximum
value")
• Add a visual level Top N filter to show the latest Start of Month
• Remove data labels, and update the title to "Revenue vs. Target"
8) Select the Matrix and activate the Edit interactions option to prevent the Treemap from filtering
9) Select "USA" in the country slicer, and drill down to select "Portland" in the Treemap
• Add a new bookmark named "Portland 1000 Sales"
• Add a new report page, named "Notes"
• Insert a text box and write something along the lines of "Portland hits 1,000 sales in December"
• Add a button (your choice) and use the "Action" properties to link it to the bookmark you created
• Test the bookmark by CTRL-clicking the button
• Find 2-3 additional insights from the Topline Performance tab and add new bookmarks and notes linking back
10) Get creative! Practice creating new visuals, pages, or bookmarks to continue exploring the data!