Power Pivot & DAX course · Lesson 16 of 16
Project: a sales dashboard with Power Pivot and DAX
Build a complete sales dashboard on the Data Model: tables, calendar, relationships, a library of DAX measures, cube-formula cards, PivotTables and slicers.
This final lesson puts the whole course together. You will build a one-page sales dashboard for the first quarter of 2026 on top of a Power Pivot model: headline figures at the top, a monthly trend, a regional breakdown and a product ranking, all controlled by slicers. Every step points back to the lesson where the technique was explained, and every number in the finished dashboard is listed so you can check your work.
The brief
The sales director wants a single sheet that answers four questions at a glance, for any region and product category she selects:
- How much did we sell, at what margin, to how many customers, and how big is an average order?
- How did revenue develop month by month, and what is the running total?
- Which regions contribute most, and which are most profitable?
- Which products are the best sellers?
Step 1: the source tables
Use the three tables from the course and load each one with Power Query as a connection to the Data Model (Importing data into the Data Model: tables, Power Query and databases):
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | OrderID | Date | CustomerID | ProductID | Qty | Amount |
| 2 | 1001 | 2026-01-05 | C1 | P1 | 2 | 1900 |
| 3 | 1002 | 2026-01-12 | C2 | P2 | 10 | 120 |
| 4 | 1003 | 2026-01-20 | C3 | P3 | 3 | 567 |
| 5 | 1004 | 2026-02-02 | C1 | P4 | 5 | 175 |
| 6 | 1005 | 2026-02-09 | C4 | P5 | 4 | 1680 |
| 7 | 1006 | 2026-02-17 | C2 | P1 | 1 | 950 |
| 8 | 1007 | 2026-03-03 | C3 | P2 | 20 | 240 |
| 9 | 1008 | 2026-03-10 | C4 | P3 | 2 | 378 |
| 10 | 1009 | 2026-03-18 | C1 | P5 | 1 | 420 |
| 11 | 1010 | 2026-03-25 | C2 | P4 | 6 | 210 |
Sales (fact table).
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | ProductID | Product | Category | Price | Cost |
| 2 | P1 | Laptop | Computers | 950 | 700 |
| 3 | P2 | Mouse | Accessories | 12 | 5 |
| 4 | P3 | Monitor | Displays | 189 | 120 |
| 5 | P4 | Keyboard | Accessories | 35 | 18 |
| 6 | P5 | Tablet | Computers | 420 | 300 |
Products (dimension).
| A | B | C | D | |
|---|---|---|---|---|
| 1 | CustomerID | Customer | Region | Segment |
| 2 | C1 | Anna Weber | North | Consumer |
| 3 | C2 | Brook Dental | South | Business |
| 4 | C3 | Carter & Co | East | Business |
| 5 | C4 | Delta Schools | West | Business |
Customers (dimension).
Step 2: the calendar
Open Power Pivot › Manage and create a calendar with Design › Date Table › New (or one of the other methods in Building a calendar (date) table for Power Pivot). Make sure it contains Year, MonthNo and Month columns, sort Month by MonthNo with Home › Sort by Column, and confirm that it is marked as the date table.
Step 3: relationships
Switch to Home › View › Diagram View and drag three relationships, all from the fact table to the dimensions (The Data Model and relationships: star schema and filter direction):
Sales[ProductID]→Products[ProductID]Sales[CustomerID]→Customers[CustomerID]Sales[Date]→'Calendar'[Date]
Then right-click Sales[ProductID], Sales[CustomerID], Sales[Date] and Sales[OrderID] and choose Hide from Client Tools. Report builders should use the dimension columns, and the measures will provide every number they need. Create a Product Hierarchy (Category › Product) in Products as in KPIs and hierarchies in Power Pivot.
Step 4: the measure library
Create the measures with Power Pivot › Calculations › Measures › New Measure, all in the Sales table, or type them in the Calculation Area. Format each one in the dialog so that every report inherits the format.
Revenue := SUM ( Sales[Amount] )
Orders := COUNTROWS ( Sales )
Customers := DISTINCTCOUNT ( Sales[CustomerID] )
Avg Order := DIVIDE ( [Revenue], [Orders] )
Cost := SUMX ( Sales, Sales[Qty] * RELATED ( Products[Cost] ) )
Margin := [Revenue] - [Cost]
Margin % := DIVIDE ( [Margin], [Revenue] )
Revenue YTD := TOTALYTD ( [Revenue], 'Calendar'[Date] )
Revenue Prev Month := CALCULATE ( [Revenue], DATEADD ( 'Calendar'[Date], -1, MONTH ) )
MoM % :=
VAR Cur = [Revenue]
VAR Prev = [Revenue Prev Month]
RETURN
IF ( NOT ISBLANK ( Cur ), DIVIDE ( Cur - Prev, Prev ) )
% of Total := DIVIDE ( [Revenue], CALCULATE ( [Revenue], ALLSELECTED ( Customers[Region] ) ) )
Product Rank :=
IF (
HASONEVALUE ( Products[Product] ),
RANKX ( ALLSELECTED ( Products[Product] ), [Revenue] )
)| Measure | Technique | Lesson |
|---|---|---|
| Revenue, Orders, Customers | SUM, COUNTROWS, DISTINCTCOUNT | Your first DAX measures: SUM, AVERAGE, COUNTROWS, DISTINCTCOUNT |
| Cost, Margin % | SUMX with RELATED, DIVIDE | Iterators in DAX: SUMX, AVERAGEX, MAXX and RANKX |
| Revenue YTD, Prev Month | TOTALYTD, DATEADD | Time intelligence in DAX: TOTALYTD, SAMEPERIODLASTYEAR, DATEADD, DATESINPERIOD |
| MoM % | VAR / RETURN, blank handling | Variables, DIVIDE and error handling in DAX |
| % of Total | CALCULATE with ALLSELECTED | Removing filters: ALL, ALLEXCEPT, ALLSELECTED and REMOVEFILTERS |
| Product Rank | RANKX with HASONEVALUE | Iterators in DAX: SUMX, AVERAGEX, MAXX and RANKX |
% of Total and Product Rank use ALLSELECTED rather than ALL on purpose: when the director picks some regions or categories in a slicer, the shares add up to 100% of her selection and the ranks restart at 1 within it.
Step 5: the headline figures with cube formulas
On a new sheet named Dashboard, reserve the top rows for four big numbers. Instead of a PivotTable, use CUBEVALUE so that the cells can be formatted as large cards (Cube functions: free-form reports from the Data Model). After inserting the two slicers in step 7, add their names as arguments:
=CUBEVALUE("ThisWorkbookDataModel","[Measures].[Revenue]",Slicer_Region,Slicer_Category)
=CUBEVALUE("ThisWorkbookDataModel","[Measures].[Margin %]",Slicer_Region,Slicer_Category)
=CUBEVALUE("ThisWorkbookDataModel","[Measures].[Customers]",Slicer_Region,Slicer_Category)
=CUBEVALUE("ThisWorkbookDataModel","[Measures].[Avg Order]",Slicer_Region,Slicer_Category)| A | B | C | D | |
|---|---|---|---|---|
| 1 | Revenue | Margin % | Customers | Avg Order |
| 2 | 6640 | 31.5% | 4 | 664.00 |
The four cards with no slicer selection. Margin % formatted as a percentage, Avg Order with 2 decimals.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Revenue | Margin % | Customers | Avg Order |
| 2 | 4950 | 27.3% | 3 | 1,237.50 |
The same cards with the Category slicer set to Computers.
With Computers selected, revenue falls to 4,950 from 6,640 total, and margin to 27.3%, because computers carry a lower margin than accessories. Three customers bought computers, in four orders.
Step 6: the three PivotTables
Insert each with Insert › PivotTable › From Data Model onto the Dashboard sheet, placed side by side below the cards. Turn off the field headers and choose a compact style in Design › PivotTable Styles.
Monthly trend
Rows: 'Calendar'[Month] (with a Year filter of 2026). Values: Revenue, Revenue YTD, MoM %, Orders. Months after March show a repeated YTD value with no revenue; set a Value filter or include only January to March in the Month filter.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Month | Revenue | Revenue YTD | MoM % | Orders |
| 2 | Jan | 2587 | 2587 | 3 | |
| 3 | Feb | 2805 | 5392 | 8.4% | 3 |
| 4 | Mar | 1248 | 6640 | -55.5% | 4 |
| 5 | Grand Total | 6640 | 6640 | 23.1% | 10 |
Monthly trend PivotTable, Jan–Mar 2026. MoM % is blank in January because December had no sales.
The Grand Total of MoM % compares January–March with the same block shifted back one month (December–February, 5,392). That figure is not meaningful, so in a real dashboard you would wrap the measure in IF ( HASONEVALUE ( 'Calendar'[Month] ), ... ) or hide the grand total with Design › Grand Totals › Off for Rows and Columns.
Regional breakdown
Rows: Customers[Region]. Values: Revenue, % of Total, Margin, Margin %.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Region | Revenue | % of Total | Margin | Margin % |
| 2 | East | 807 | 12.2% | 347 | 43.0% |
| 3 | North | 2495 | 37.6% | 705 | 28.3% |
| 4 | South | 1280 | 19.3% | 422 | 33.0% |
| 5 | West | 2058 | 31.0% | 618 | 30.0% |
| 6 | Grand Total | 6640 | 100.0% | 2092 | 31.5% |
Regional PivotTable with no slicer selection.
North is the largest region with 37.6% of revenue. East has the highest margin percentage: Carter & Co bought monitors and many mice, both high-margin products.
Product ranking
Rows: Products[Product]. Values: Revenue, Product Rank. Sort by Revenue descending (right-click a value › Sort › Sort Largest to Smallest).
| A | B | C | |
|---|---|---|---|
| 1 | Product | Revenue | Product Rank |
| 2 | Laptop | 2850 | 1 |
| 3 | Tablet | 2100 | 2 |
| 4 | Monitor | 945 | 3 |
| 5 | Keyboard | 385 | 4 |
| 6 | Mouse | 360 | 5 |
Product ranking PivotTable.
Step 7: slicers and connections
- Click the monthly PivotTable and choose PivotTable Analyze › Filter › Insert Slicer. Tick
Customers[Region]andProducts[Category]. - Right-click each slicer and choose Report Connections…. Tick all three PivotTables so that one click filters the whole page.
- Check the slicer names in Slicer › Slicer Settings and use exactly those names in the cube formulas of step 5.
- Optionally add a timeline with PivotTable Analyze › Filter › Insert Timeline on
'Calendar'[Date], and connect it to the PivotTables in the same way.
Step 8: a chart and finishing touches
- Add a PivotChart for the monthly trend (PivotTable Analyze › Tools › PivotChart, clustered column with Revenue YTD as a line on a secondary axis). Hide the field buttons with PivotChart Analyze › Show/Hide › Field Buttons.
- Turn off gridlines (View › Show › Gridlines) and add a title and a 'data as of' note.
- Protect the layout with Review › Protect Sheet, allowing Use PivotTable & PivotChart so that slicers still work.
- Save as .xlsx. The model is stored inside; no external files are needed apart from the sources Power Query refreshes from.
Step 9: test before you share
- Totals match the source: 6,640 revenue and 10 orders, which you can confirm with SUM and COUNTA on the source sheet.
- Select each region in turn and check that the cards and the regional PivotTable agree.
- Select a combination with no data (West and Accessories) and make sure the cards go blank rather than showing errors.
- Refresh with Data › Refresh All after changing a source row and confirm that every element updates.
Where to go next
You now know the core of DAX: the model, filter and row context, CALCULATE, iterators, time intelligence and robust measure writing. Natural next steps are Power BI Desktop, which uses the same model and language with more visuals, and the Power Query course on this site for cleaner, more automated data loading. For broader dashboard design ideas, see Project: build a sales dashboard from scratch in the Excel course.
Check yourself
1. Why are the foreign key columns of Sales hidden from client tools?
Hidden keys still drive relationships but keep the field list clean.
2. Why does % of Total use ALLSELECTED instead of ALL?
ALLSELECTED keeps filters coming from slicers.
3. How do the cube-formula cards follow the slicers?
Slicer names act as member arguments.
4. What makes one slicer filter three PivotTables?
Report Connections links a slicer to several PivotTables on the same model.
5. Why is MoM % blank in January?
DIVIDE returns blank when the denominator is blank.