一键导入
power-bi-retail-analytics-dashboard
Power BI retail sales dashboard for multi-dimensional profit, regional, and sales analysis with predictive insights
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Power BI retail sales dashboard for multi-dimensional profit, regional, and sales analysis with predictive insights
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Full-stack user management system with AI-powered analytics, risk detection, and task management capabilities
Full-stack user management system with AI-powered analytics for risk detection, burnout analysis, and ticket classification
Master the CommerceVault middleware for Easy Digital Downloads API integration, sales analytics, order management, and digital product orchestration.
MCP server for Easy Digital Downloads API integration enabling sales analytics, product management, and order orchestration
Master the CommerceVault middleware for Easy Digital Downloads API integration, sales analytics, and digital commerce orchestration
Build interactive Power BI sales dashboards with regional analysis, profit tracking, and predictive insights using the SalesPulse 360 framework
| name | power-bi-retail-analytics-dashboard |
| description | Power BI retail sales dashboard for multi-dimensional profit, regional, and sales analysis with predictive insights |
| triggers | ["create a Power BI retail sales dashboard","analyze sales data by region and profit","build an interactive Power BI analytics report","set up SalesPulse 360 dashboard","configure Power BI data refresh and alerts","implement retail KPI visualization in Power BI","troubleshoot Power BI dashboard performance","add predictive forecasting to sales dashboard"] |
Skill by ara.so — Data Skills collection.
This skill enables AI coding agents to work with SalesPulse 360, a comprehensive Power BI retail analytics dashboard designed for multi-dimensional sales, profit, and regional analysis. The project transforms raw sales data into interactive visualizations with predictive forecasting, exception alerts, and multi-granularity filtering.
SalesPulse 360 is a production-ready Power BI dashboard that:
The dashboard is built on the Global Superstore dataset (2011-2015) but can be adapted to any retail/sales data source.
git clone https://github.com/MahbubNibir/power-bi-retail-analytics-viz.git
cd power-bi-retail-analytics-viz
The Global Superstore dataset is included as a compressed file:
# Extract the dataset (location varies by OS)
# Windows
tar -xf data/GlobalSuperstore.zip -C data/
# macOS/Linux
unzip data/GlobalSuperstore.zip -d data/
# Open the main dashboard file
start SalesPulse360.pbix # Windows
open SalesPulse360.pbix # macOS
On first load, Power BI Desktop will:
If you've moved the dataset to a custom location:
The dashboard uses a star schema:
Fact Table: Orders
├── OrderID (unique identifier)
├── OrderDate, ShipDate
├── Sales, Profit, Quantity, Discount
└── Foreign keys to dimensions
Dimension Tables:
├── DimCustomer (CustomerID, Segment, CustomerName)
├── DimProduct (ProductID, Category, SubCategory, ProductName)
├── DimLocation (Region, Country, State, City, PostalCode)
└── DimDate (Date, Year, Quarter, Month, Week, DayOfWeek)
Key calculated measures used throughout the dashboard:
-- Total Sales (baseline measure)
Total Sales = SUM(Orders[Sales])
-- Profit Margin (percentage)
Profit Margin % =
DIVIDE(
SUM(Orders[Profit]),
SUM(Orders[Sales]),
0
)
-- Moving Annual Total (MAT)
Sales MAT =
CALCULATE(
[Total Sales],
DATESINPERIOD(
DimDate[Date],
LASTDATE(DimDate[Date]),
-12,
MONTH
)
)
-- Year-over-Year Growth
YoY Growth % =
VAR CurrentPeriodSales = [Total Sales]
VAR PreviousYearSales =
CALCULATE(
[Total Sales],
SAMEPERIODLASTYEAR(DimDate[Date])
)
RETURN
DIVIDE(
CurrentPeriodSales - PreviousYearSales,
PreviousYearSales,
0
)
-- Profit Alert Flag (for exception reporting)
Profit Alert =
IF(
[Profit Margin %] < 0.15, -- 15% threshold
"⚠ Low Margin",
"✓ Healthy"
)
-- Customer Retention Index
Retention Index =
VAR RepeatCustomers =
CALCULATE(
DISTINCTCOUNT(Orders[CustomerID]),
Orders[OrderCount] > 1
)
VAR TotalCustomers = DISTINCTCOUNT(Orders[CustomerID])
RETURN
DIVIDE(RepeatCustomers, TotalCustomers, 0)
The ETL pipeline in Power Query performs:
// Remove duplicates and null values
let
Source = Csv.Document(File.Contents("data/GlobalSuperstore.csv")),
Headers = Table.PromoteHeaders(Source),
CleanedData = Table.RemoveRowsWithErrors(Headers),
// Type conversions
TypedData = Table.TransformColumnTypes(CleanedData, {
{"Order Date", type date},
{"Ship Date", type date},
{"Sales", Currency.Type},
{"Profit", Currency.Type},
{"Quantity", Int64.Type},
{"Discount", Percentage.Type}
}),
// Add calculated columns
WithProfitMargin = Table.AddColumn(
TypedData,
"Profit Margin",
each [Profit] / [Sales],
Percentage.Type
),
// Remove irrelevant columns
FinalTable = Table.SelectColumns(WithProfitMargin, {
"Order ID", "Order Date", "Ship Date",
"Customer ID", "Customer Name", "Segment",
"Product ID", "Category", "Sub-Category",
"Region", "Country", "State", "City",
"Sales", "Profit", "Quantity", "Discount", "Profit Margin"
})
in
FinalTable
The dashboard includes a Settings table for configurable parameters:
| Parameter | Default | Description |
|---|---|---|
ProfitMarginThreshold | 0.15 | Minimum acceptable profit margin (15%) |
ReturnRateWarning | 0.08 | Return rate trigger for alerts (8%) |
RollingAvgDays | 90 | Period for moving averages |
ForecastMonths | 12 | Months to project in forecasts |
These values are referenced in DAX measures:
Dynamic Profit Alert =
VAR Threshold = SELECTEDVALUE(ConfigSettings[ProfitMarginThreshold])
RETURN
IF([Profit Margin %] < Threshold, "⚠", "✓")
To add a new language translation:
Create a new table Translations with columns:
Key (English label)Language (ISO code: en, es, fr, de, zh)Translation (localized text)Use this DAX pattern for dynamic labels:
Dynamic Label =
VAR SelectedLanguage = SELECTEDVALUE(Settings[Language], "en")
VAR LabelKey = "Total Sales"
RETURN
LOOKUPVALUE(
Translations[Translation],
Translations[Key], LabelKey,
Translations[Language], SelectedLanguage,
LabelKey -- fallback to English
)
After publishing to Power BI Service:
Navigate to your workspace → Settings → Datasets
Select SalesPulse360 dataset
Under Scheduled refresh:
For real-time data, configure Streaming datasets instead:
To analyze underperforming regions:
-- Create a measure for regional ranking
Region Profit Rank =
RANKX(
ALL(DimLocation[Region]),
[Total Profit],
,
DESC,
DENSE
)
-- Filter to bottom 25% regions
Bottom Regions =
CALCULATE(
[Total Profit],
FILTER(
ALL(DimLocation[Region]),
[Region Profit Rank] > COUNTROWS(ALL(DimLocation[Region])) * 0.75
)
)
Use in a table visual with drill-through to city-level details.
Enable forecasting on a line chart:
Add a Line Chart visual with:
DimDate[Date][Total Sales]In the Analytics pane:
The forecast uses exponential smoothing:
-- Manual forecast calculation (alternative to built-in)
Sales Forecast =
VAR HistoricalAvg = CALCULATE([Total Sales], DATESINPERIOD(DimDate[Date], MAX(DimDate[Date]), -12, MONTH))
VAR SeasonalityFactor =
DIVIDE(
CALCULATE([Total Sales], SAMEPERIODLASTYEAR(DimDate[Date])),
HistoricalAvg,
1
)
RETURN
HistoricalAvg * SeasonalityFactor
To highlight cells where profit margin < 15%:
Profit Margin Color =
SWITCH(
TRUE(),
[Profit Margin %] < 0.10, "#E74C3C", -- Red (< 10%)
[Profit Margin %] < 0.15, "#F39C12", -- Orange (10-15%)
"#27AE60" -- Green (>= 15%)
)
Create a dynamic dashboard title that reflects active filters:
Dashboard Title =
VAR SelectedRegion = IF(ISFILTERED(DimLocation[Region]), SELECTEDVALUE(DimLocation[Region]), "All Regions")
VAR SelectedCategory = IF(ISFILTERED(DimProduct[Category]), SELECTEDVALUE(DimProduct[Category]), "All Categories")
VAR SelectedYear = IF(ISFILTERED(DimDate[Year]), SELECTEDVALUE(DimDate[Year]), "All Years")
RETURN
"SalesPulse 360 | " & SelectedRegion & " | " & SelectedCategory & " | " & SelectedYear
Replace the CSV source with a live database:
your-server.database.windows.netSalesDBQuery example:
SELECT
o.OrderID,
o.OrderDate,
o.ShipDate,
c.CustomerName,
c.Segment,
p.ProductName,
p.Category,
p.SubCategory,
l.Region,
l.Country,
l.State,
o.Sales,
o.Profit,
o.Quantity,
o.Discount
FROM Orders o
JOIN Customers c ON o.CustomerID = c.CustomerID
JOIN Products p ON o.ProductID = p.ProductID
JOIN Locations l ON o.LocationID = l.LocationID
WHERE o.OrderDate >= '2020-01-01'
For database connections in Power Query:
let
Server = Environment.GetEnvironmentVariable("SQL_SERVER"),
Database = Environment.GetEnvironmentVariable("SQL_DATABASE"),
Source = Sql.Database(Server, Database)
in
Source
Set environment variables before opening Power BI Desktop:
# Windows (PowerShell)
$env:SQL_SERVER="your-server.database.windows.net"
$env:SQL_DATABASE="SalesDB"
# macOS/Linux
export SQL_SERVER="your-server.database.windows.net"
export SQL_DATABASE="SalesDB"
Symptom: Scheduled refresh shows "Failed" status
Solutions:
Check data source credentials:
Verify gateway connection (for on-premises data):
Reduce data volume:
// Add date filter in Power Query
let
Source = ...,
FilteredData = Table.SelectRows(Source, each [OrderDate] >= #date(2022, 1, 1))
in
FilteredData
Symptom: Visuals take 10+ seconds to render
Solutions:
-- SLOW (row iteration)
Total Profit Slow =
SUMX(
Orders,
Orders[Sales] * Orders[ProfitMargin]
)
-- FAST (column aggregation)
Total Profit Fast = SUM(Orders[Profit])
Reduce visual count - limit to 15-20 visuals per page
Use aggregations:
-- Pre-aggregate at monthly level
Monthly Sales =
SUMMARIZE(
Orders,
DimDate[Year],
DimDate[Month],
"Sales", SUM(Orders[Sales])
)
Switch to DirectQuery for datasets > 1GB
Symptom: Built-in forecast generates a horizontal projection
Cause: Insufficient historical data or no seasonality detected
Solutions:
Ensure at least 2 full seasonal cycles (24 months for monthly data)
Manually set seasonality:
Use custom DAX forecast:
Manual Forecast =
VAR LastKnownDate = MAX(DimDate[Date])
VAR ForecastDate = SELECTEDVALUE(DimDate[Date])
VAR IsHistorical = ForecastDate <= LastKnownDate
RETURN
IF(
IsHistorical,
[Total Sales], -- Historical actual
[Sales Forecast] -- Custom projection measure
)
Symptom: Slicer selections don't persist when navigating pages
Solution: Configure report-level filters:
Symptom: Users see all regions despite RLS configuration
DAX RLS Configuration:
-- In Modeling → Manage Roles → Create role "Regional Manager"
-- Filter on DimLocation table:
[Region] = USERPRINCIPALNAME()
-- Or using a security mapping table:
[Region] IN
CALCULATETABLE(
VALUES(SecurityMapping[Region]),
FILTER(
SecurityMapping,
SecurityMapping[UserEmail] = USERPRINCIPALNAME()
)
)
Testing:
user@domain.comTrack customer behavior by cohort (month of first purchase):
-- Calculate first purchase month for each customer
First Purchase Month =
CALCULATE(
MIN(Orders[OrderDate]),
ALLEXCEPT(Orders, Orders[CustomerID])
)
-- Cohort label
Cohort = FORMAT([First Purchase Month], "YYYY-MM")
-- Retention by cohort (months since first purchase)
Months Since First Purchase =
DATEDIFF(
[First Purchase Month],
MAX(DimDate[Date]),
MONTH
)
-- Cohort retention rate
Cohort Retention % =
VAR CohortSize =
CALCULATE(
DISTINCTCOUNT(Orders[CustomerID]),
FILTER(ALL(DimDate), DimDate[Date] = [First Purchase Month])
)
VAR ActiveInPeriod = DISTINCTCOUNT(Orders[CustomerID])
RETURN
DIVIDE(ActiveInPeriod, CohortSize, 0)
Create a matrix visual:
[Cohort][Months Since First Purchase][Cohort Retention %]Classify products by contribution to profit (Pareto analysis):
-- Calculate cumulative profit percentage
Product Profit % =
DIVIDE(
SUM(Orders[Profit]),
CALCULATE(SUM(Orders[Profit]), ALL(DimProduct)),
0
)
Cumulative Profit % =
VAR CurrentProduct = SELECTEDVALUE(DimProduct[ProductID])
VAR RankPosition =
RANKX(
ALL(DimProduct),
[Product Profit %],
,
DESC,
DENSE
)
RETURN
CALCULATE(
SUM([Product Profit %]),
FILTER(
ALL(DimProduct),
RANKX(ALL(DimProduct), [Product Profit %], , DESC) <= RankPosition
)
)
-- ABC Classification
ABC Class =
SWITCH(
TRUE(),
[Cumulative Profit %] <= 0.70, "A - Top 70%",
[Cumulative Profit %] <= 0.90, "B - Next 20%",
"C - Bottom 10%"
)
Flag orders with shipping delays and calculate impact:
-- Standard shipping time by category
Expected Ship Days =
SWITCH(
SELECTEDVALUE(DimProduct[Category]),
"Technology", 3,
"Furniture", 5,
"Office Supplies", 2,
3 -- default
)
-- Actual shipping time
Actual Ship Days =
DATEDIFF(Orders[OrderDate], Orders[ShipDate], DAY)
-- Delay flag
Shipping Delay =
IF(
[Actual Ship Days] > [Expected Ship Days],
"⚠ Delayed",
"✓ On Time"
)
-- Lost profit from delays (assume 2% customer churn per delayed order)
Delay Impact $ =
CALCULATE(
SUM(Orders[Profit]) * 0.02,
Orders[Actual Ship Days] > [Expected Ship Days]
)
Add a discount scenario slider:
Discount ScenarioUse in calculations:
Projected Sales =
VAR CurrentSales = [Total Sales]
VAR DiscountImpact = [Discount Scenario Value] * 0.5 -- 50% sensitivity
RETURN
CurrentSales * (1 - DiscountImpact)
Projected Profit =
VAR CurrentProfit = [Total Profit]
VAR DiscountImpact = [Discount Scenario Value] * 0.8 -- 80% sensitivity
RETURN
CurrentProfit * (1 - DiscountImpact)
Create a detail page for product deep-dive:
DimProduct[ProductName]Right-click any product in the main dashboard → Drill through → Product Details
Segment customers using K-means (requires Python in Power BI):
# Python script visual
import pandas as pd
from sklearn.cluster import KMeans
from sklearn.preprocessing import StandardScaler
# Input dataset is automatically available as 'dataset'
df = dataset[['CustomerID', 'TotalSpend', 'OrderFrequency', 'AvgOrderValue']]
# Standardize features
scaler = StandardScaler()
scaled_features = scaler.fit_transform(df[['TotalSpend', 'OrderFrequency', 'AvgOrderValue']])
# K-means clustering
kmeans = KMeans(n_clusters=4, random_state=42)
df['Cluster'] = kmeans.fit_predict(scaled_features)
# Cluster labels
cluster_labels = {
0: 'High-Value Loyalists',
1: 'Occasional Big Spenders',
2: 'Frequent Low-Value',
3: 'At-Risk'
}
df['Segment'] = df['Cluster'].map(cluster_labels)
# Output must be assigned to 'dataset' for Power BI
dataset = df
Enable Python scripting:
Use variables in DAX to improve readability and performance:
Profit Margin % =
VAR TotalProfit = SUM(Orders[Profit])
VAR TotalSales = SUM(Orders[Sales])
RETURN DIVIDE(TotalProfit, TotalSales, 0)
Avoid circular dependencies - never reference a calculated column in a measure that feeds back to that column
Document measures with descriptions:
"Calculates year-over-year growth using SAMEPERIODLASTYEAR"Use measure groups for organization:
[Sales Metrics], [Profit Metrics], [Forecasts]Test with realistic data volumes - performance degrades non-linearly
Version control .pbix files using Git LFS:
git lfs track "*.pbix"
git add .gitattributes
git commit -m "Track Power BI files with LFS"
This skill enables comprehensive retail analytics dashboard development, from basic setup to advanced predictive modeling and custom data integrations.