Skip to content
0

Electrify your insights with BI

📖 Background

Equipment, such as computers and smartphones, is widely available today, and the global consumer electronics market generated an impressive $950 billion in revenue in 2024.

What better way than to utilize your BI skills on a dataset related to this vast industry? As a BI analyst for GlobalElec, a leading global electronics retailer, you will help analyze and visualize the company’s sales data, covering customers, products, sales, stores, and international exchange rates.

Your task is to uncover trends like the dominance of telephony, the rise of online sales, and regional market leaders while crafting impactful dashboards in a BI tool of your choice.

Showcase your ability to transform raw data into actionable insights and shape the future of GlobalElec!

import pandas as pd

# Load all CSVs
sales = pd.read_csv("data/Sales.csv")
exchange = pd.read_csv("data/Exchange_Rates.csv",encoding="latin1")
stores = pd.read_csv("data/Stores.csv")
customers = pd.read_csv("data/Customers.csv",encoding="latin1")
products = pd.read_csv("data/Products.csv")


# --- Step 1: Merge Sales with Customers ---
merged = pd.merge(sales, customers, on="CustomerKey", how="left")

# --- Step 2: Merge with Products ---
merged = pd.merge(merged, products, on="ProductKey", how="left")

# --- Step 3: Merge with Stores ---
merged = pd.merge(merged, stores, on="StoreKey", how="left")

# --- Step 4: Merge with Exchange Rates (composite key: Currency + Date) ---
# Create composite key in both dataframes
merged["CurrencyDateKey"] = merged["Currency Code"].astype(str) + "-" + merged["Order Date"].astype(str)
exchange["CurrencyDateKey"] = exchange["Currency"].astype(str) + "-" + exchange["Date"].astype(str)

# Now merge
merged = pd.merge(merged, exchange[["CurrencyDateKey", "Exchange"]], on="CurrencyDateKey", how="left")

# --- Step 5: Drop helper key (optional) ---
merged.drop(columns=["CurrencyDateKey"], inplace=True)

# Save final merged dataset
merged.to_csv("final_dataset.csv", index=False)

print("✅ Final dataset created:", merged.shape)
print(merged.head())

merged.info()

💾 The data

The data can be downloaded from the Files section (File > Show workbook files).

GroupColumn nameDatasetDefinition
CustomersCustomerKeyCustomers.csvPrimary key to identify customers
CustomersGenderCustomers.csvCustomer gender
CustomersNameCustomers.csvCustomer full name
CustomersCityCustomers.csvCustomer city
CustomersState CodeCustomers.csvCustomer state (abbreviated)
CustomersStateCustomers.csvCustomer state (full)
CustomersZip CodeCustomers.csvCustomer zip code
CustomersCountryCustomers.csvCustomer country
CustomersContinentCustomers.csvCustomer continent
CustomersBirthdayCustomers.csvCustomer date of birth
ProductsProductKeyProducts.csvPrimary key to identify products
ProductsProduct NameProducts.csvProduct name
ProductsBrandProducts.csvProduct brand
ProductsColorProducts.csvProduct color
ProductsUnit Cost USDProducts.csvCost to produce the product in USD
ProductsUnit Price USDProducts.csvProduct list price in USD
ProductsSubcategoryKeyProducts.csvKey to identify product subcategories
ProductsSubcategoryProducts.csvProduct subcategory name
ProductsCategoryKeyProducts.csvKey to identify product categories
ProductsCategoryProducts.csvProduct category name
SalesOrder NumberSales.csvUnique ID for each order
SalesLine ItemSales.csvIdentifies individual products purchased
SalesOrder DateSales.csvDate the order was placed
SalesDelivery DateSales.csvDate the order was delivered
SalesCustomerKeySales.csvUnique key identifying which customer ordered
SalesStoreKeySales.csvUnique key identifying which store processed
SalesProductKeySales.csvUnique key identifying which product purchased
SalesQuantitySales.csvNumber of items purchased
SalesCurrency CodeSales.csvCurrency used to process the order
StoresStoreKeyStores.csvPrimary key to identify stores
StoresCountryStores.csvStore country
StoresStateStores.csvStore state
StoresSquare MetersStores.csvStore footprint in square meters
StoresOpen DateStores.csvStore open date
Exchange RatesDateExchange_Rates.csvDate
Exchange RatesCurrencyExchange_Rates.csvCurrency code
Exchange RatesExchangeExchange_Rates.csvExchange rate compared to USD
merged_data.to_csv("ElectrifyYourInsights.csv")
Exchange_rate = pd.read_csv("data/Exchange_Rates.csv", encoding="latin1")
Exchange_rate.head()
Sales = pd.read_csv("data/Sales.csv", encoding="latin1")
Sales.head()
Sales["Order Date"]
print(Sales["Order Date"].value_counts(dropna=False))  # dropna=False shows NaN counts too

print("\n" + "="*50 + "\n")
Sales["Order Date"] = pd.to_datetime(Sales["Order Date"], format='%m/%d/%Y')
print(Sales["Order Date"].value_counts(dropna=False))  # dropna=False shows NaN counts too

print("\n" + "="*50 + "\n")
# Extract date components
Sales['Year'] = Sales['Order Date'].dt.year
Sales['Month'] = Sales['Order Date'].dt.month
Sales['Day_of_Week'] = Sales['Order Date'].dt.day_name()

# Filter by date ranges
recent_orders = Sales[Sales['Order Date'] >= '2020-01-01']

# Group by month/year
# Only sum numeric columns to avoid summing datetime columns
monthly_sales = Sales.groupby(Sales['Order Date'].dt.to_period('M')).sum(numeric_only=True)

# Sort by date
Sales_sorted = Sales.sort_values('Order Date')

💪 Challenge

Using any BI tool you have access to, create interactive visuals and a dashboard to summarize your research. Things to consider:

  1. Use this Workspace to prepare your data (optional).
  2. Some ideas to get you started (Don't feel limited by these, you're encouraged to use your skills to consolidate as much information as possible):
    • Which countries or regions contribute the most to overall revenue?
    • Which product categories and regions yield the highest profit margins?
    • Are there patterns or changes in delivery times across different regions or product categories?
  3. Create a screenshot of your main dashboard/visuals, and paste that into the designated field.
  4. Summarize your findings in an executive summary.

✍️ Judging criteria

This is a community-based competition. The top 5 most upvoted entries will win.

The winners will receive DataCamp merchandise.