Messy data to actionable insights: HOW ANALYST USE POWER BI, DAX, AND DASHBOARDS.
Source: Dev.to
The Analytics Workflow (Big Picture)
Most Power BI projects follow this flow:
Raw Data → Cleaning (Power Query) → Data Model → DAX Measures → Dashboards → Decisions
📊 Visual Flow Diagram (Conceptual)
[ Excel / CSV / SQL / APIs ]
|
v
[ Power Query ]
|
v
[ Data Model ]
|
v
[ DAX ]
|
v
[ Dashboards ]
|
v
[ Business Actions ]
Step 1 – Load Messy Data into Power BI
In the real world, data usually comes with problems:
- ❌ Duplicate rows
- ❌ Blank values
- ❌ Wrong data types (numbers stored as text)
- ❌ Inconsistent column names
- ❌ Multiple date formats
How to Load Data
- In Power BI Desktop, click Home → Get Data.
- Choose Excel / CSV / SQL Server (or another source).
- Click Transform Data (don’t click Load yet).
This opens Power Query, where cleaning happens.
Step 2 – Clean and Prepare Data (Power Query)
Power Query is your staging area. Anything you fix here becomes repeatable and automatic.
Common Cleaning Tasks
| Problem | Power Query Fix |
|---|---|
| Duplicates | Remove Rows → Remove Duplicates |
| Text with spaces | Transform → Format → Trim |
| Wrong data type | Change column type |
| Messy column names | Rename columns |
| Null values | Replace values / Filter |
Example
Before
Customer | Sales | Order Date
John Doe | "1,000" | 02/01/24
John Doe | "1000 " | 2024-01-02
After
Customer | Sales | Order Date
John Doe | 1000 | 2024-01-02
Step 3 – Create a Proper Data Model
A good data model = better performance + easier DAX.
Typical Tables
- Sales (fact table)
- Customers (dimension)
- Products (dimension)
- Date (calendar table)
Star Schema (Recommended)
Customers ──┐
├── Sales ── Date
Products ───┘
Modeling Best Practices
- ✅ One fact table, multiple dimension tables
- ✅ One‑direction relationships (unless a specific need)
- ✅ Always use a Date table
- ❌ Avoid many‑to‑many relationships unless necessary
Your DAX calculations depend on relationships to filter data correctly.
Step 4 – Write DAX Measures (Beginner → Technical)
DAX = Data Analysis Expressions – the language Power BI uses to calculate metrics.
Start Simple
Total Sales =
SUM ( Sales[Amount] )
Total Orders =
COUNTROWS ( Sales )
Total Customers =
DISTINCTCOUNT ( Customers[CustomerID] )
Slightly More Technical: Time Intelligence
Sales MTD =
CALCULATE (
[Total Sales],
DATESMTD ( 'Date'[Date] )
)
Sales Last Month =
CALCULATE (
[Total Sales],
DATEADD ( 'Date'[Date], -1, MONTH )
)
MoM Growth % =
DIVIDE (
[Sales MTD] - [Sales Last Month],
[Sales Last Month]
)
DAX Hack Tips
- Use measures, not calculated columns, whenever possible.
- Always create a Date table for time‑intelligence functions.
- Use
DIVIDE()instead of/to avoid division‑by‑zero errors. - Build and test one measure at a time.
Step 5 – Build Dashboards That Answer Questions
A good dashboard answers:
- What is happening?
- How is it trending?
- Where should we act?
Example Layout
+----------------------------------------+
| KPI Cards: Sales, Orders, Growth |
+----------------------------------------+
| Sales Trend (Line Chart) |
+----------------------------------------+
| Sales by Product | Sales by City |
+----------------------------------------+
| Filters (Date, Region) |
+----------------------------------------+
Visual Best Practices
- KPI Cards → summary metrics
- Line charts → trends over time
- Bar charts → comparisons across categories
- Slicers → user interaction (filters)
- Keep colors simple and consistent
If your dashboard needs a lengthy explanation, it’s probably too complex.
Step 6 – Turn Insights into Action
Dashboards are only useful when they change behavior.
Example Workflow
- 📉 Sales drop in Nairobi
- ➡️ Filter by product
- ➡️ Identify stock‑outs
- ➡️ Fix supply‑chain issue
- ➡️ Sales recover
This is where data becomes impact.
Hands‑On Practice
Exercise 1 – Data Cleaning
- Remove duplicates
- Fix data types
- Rename columns
- Remove null rows
Exercise 2 – DAX Measures
Total Sales = SUM ( Sales[Amount] )
Total Orders = COUNTROWS ( Sales )
Average Order Value = DIVIDE ( [Total Sales], [Total Orders] )
Exercise 3 – Dashboard
Build a simple report containing:
- 1 KPI card
- 1 trend (line) chart
- 1 bar chart
- 1 slicer (e.g., date or region)
Power BI + DAX Cheat Sheet
Power Query
| Task | Action |
|---|---|
| Remove duplicates | Home → Remove Rows → Remove Duplicates |
| Change data type | Click column header → Data Type |
| Trim spaces | Transform → Format → Trim |
| Split column | Transform → Split Column |
DAX
| Goal | Function |
|---|---|
| Sum values | SUM() |
| Count rows | COUNTROWS() |
| Distinct count | DISTINCTCOUNT() |
| Apply filters | CALCULATE() |
| Time‑intelligence | DATESMTD(), DATEADD(), etc. |
| Safe division | DIVIDE() |
Power BI Intelligence
Useful DAX Functions
DATESMTD()– Returns a table that contains a column of dates for the month to date, in the current filter context.DATEADD()– Returns a table that contains a column of dates shifted by a specified number of intervals.
Safe Division
DIVIDE()– Performs division and returns an alternate result when the divisor is zero.
Modeling Guidelines
- Use a Date table – Centralize date logic and enable time‑intelligence functions.
- Prefer a star schema – Keeps the model simple, performant, and easy to understand.
- Avoid bi‑directional relationships unless they are truly required.
Lessons Learned So Far
Power BI isn’t just about making pretty charts.
It’s about building reliable data pipelines that lead to better decisions.
The real skill isn’t only DAX or visuals – it’s understanding what question the business is trying to answer.
If You’re New to Power BI
- Start messy – Get data into the model, even if it’s imperfect.
- Build small – Create simple visuals and measures first.
- Improve one step at a time – Refine data quality, model design, and visuals iteratively.
You’re doing real analytics when your data isn’t perfect, but you’re still able to extract actionable insights.