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.

Advanced 30 min read

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:

  1. How much did we sell, at what margin, to how many customers, and how big is an average order?
  2. How did revenue develop month by month, and what is the running total?
  3. Which regions contribute most, and which are most profitable?
  4. 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):

ABCDEF
1OrderIDDateCustomerIDProductIDQtyAmount
210012026-01-05C1P121900
310022026-01-12C2P210120
410032026-01-20C3P33567
510042026-02-02C1P45175
610052026-02-09C4P541680
710062026-02-17C2P11950
810072026-03-03C3P220240
910082026-03-10C4P32378
1010092026-03-18C1P51420
1110102026-03-25C2P46210

Sales (fact table).

ABCDE
1ProductIDProductCategoryPriceCost
2P1LaptopComputers950700
3P2MouseAccessories125
4P3MonitorDisplays189120
5P4KeyboardAccessories3518
6P5TabletComputers420300

Products (dimension).

ABCD
1CustomerIDCustomerRegionSegment
2C1Anna WeberNorthConsumer
3C2Brook DentalSouthBusiness
4C3Carter & CoEastBusiness
5C4Delta SchoolsWestBusiness

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.

DAX
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] )
)
Twelve measures: base figures, iterator cost, time intelligence, share and rank.
MeasureTechniqueLesson
Revenue, Orders, CustomersSUM, COUNTROWS, DISTINCTCOUNTYour first DAX measures: SUM, AVERAGE, COUNTROWS, DISTINCTCOUNT
Cost, Margin %SUMX with RELATED, DIVIDEIterators in DAX: SUMX, AVERAGEX, MAXX and RANKX
Revenue YTD, Prev MonthTOTALYTD, DATEADDTime intelligence in DAX: TOTALYTD, SAMEPERIODLASTYEAR, DATEADD, DATESINPERIOD
MoM %VAR / RETURN, blank handlingVariables, DIVIDE and error handling in DAX
% of TotalCALCULATE with ALLSELECTEDRemoving filters: ALL, ALLEXCEPT, ALLSELECTED and REMOVEFILTERS
Product RankRANKX with HASONEVALUEIterators 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:

DAX
=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)
Four Excel formulas in B3, D3, F3 and H3 (labels above them).
ABCD
1RevenueMargin %CustomersAvg Order
2664031.5%4664.00

The four cards with no slicer selection. Margin % formatted as a percentage, Avg Order with 2 decimals.

ABCD
1RevenueMargin %CustomersAvg Order
2495027.3%31,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.

ABCDE
1MonthRevenueRevenue YTDMoM %Orders
2Jan258725873
3Feb280553928.4%3
4Mar12486640-55.5%4
5Grand Total6640664023.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 %.

ABCDE
1RegionRevenue% of TotalMarginMargin %
2East80712.2%34743.0%
3North249537.6%70528.3%
4South128019.3%42233.0%
5West205831.0%61830.0%
6Grand Total6640100.0%209231.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).

ABC
1ProductRevenueProduct Rank
2Laptop28501
3Tablet21002
4Monitor9453
5Keyboard3854
6Mouse3605

Product ranking PivotTable.

Step 7: slicers and connections

  1. Click the monthly PivotTable and choose PivotTable Analyze › Filter › Insert Slicer. Tick Customers[Region] and Products[Category].
  2. Right-click each slicer and choose Report Connections…. Tick all three PivotTables so that one click filters the whole page.
  3. Check the slicer names in Slicer › Slicer Settings and use exactly those names in the cube formulas of step 5.
  4. Optionally add a timeline with PivotTable Analyze › Filter › Insert Timeline on 'Calendar'[Date], and connect it to the PivotTables in the same way.
Tip. Slicers on dimension columns work for every PivotTable on the model, even ones that do not show that field. That is the power of relationships: one slicer on Products filters Sales and therefore every measure.

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.
Watch out. Remember the platform limit from What is Power Pivot? Versions, enabling the add-in and a first look: colleagues on Excel for Mac or Excel for the web can open the dashboard and use slicers on the existing PivotTables, but they cannot edit the measures or the model. Keep the master copy on Windows.

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?

2. Why does % of Total use ALLSELECTED instead of ALL?

3. How do the cube-formula cards follow the slicers?

4. What makes one slicer filter three PivotTables?

5. Why is MoM % blank in January?