Power Pivot & DAX course · Lesson 14 of 16
KPIs and hierarchies in Power Pivot
Create Power Pivot KPIs with a target measure and traffic-light status, build Category › Product and date hierarchies, and write a percent-of-parent measure.
Two features of Power Pivot turn a collection of measures into a model that business users enjoy: KPIs, which compare a measure with a target and show a traffic-light status, and hierarchies, which give users ready-made drill paths such as Category › Product or Year › Quarter › Month. Neither requires much DAX, but both need careful setup.
Part 1: KPIs
A KPI (key performance indicator) in the Data Model has three parts:
- Value: the base measure, for example
Revenue. - Goal (target): another measure, or a fixed number.
- Status: a score of −1, 0 or 1 calculated from how far the value is from the goal, shown as icons.
We continue with the two-year data from Time intelligence in DAX: TOTALYTD, SAMEPERIODLASTYEAR, DATEADD, DATESINPERIOD. The target for each month is last year's revenue plus 10%:
Revenue := SUM ( Sales[Amount] )
Revenue LY := CALCULATE ( [Revenue], SAMEPERIODLASTYEAR ( 'Calendar'[Date] ) )
Revenue Target := [Revenue LY] * 1.1Creating the KPI
- Choose Power Pivot › Calculations › KPIs › New KPI… (or right-click the
Revenuemeasure in the Calculation Area and choose Create KPI). - KPI base field (value):
Revenue. - Define target value: choose Measure and pick
Revenue Target. (Choose Absolute value for a fixed number such as 2,000.) - Define status thresholds: pick the layout where low values are red and high values green, then drag the two markers or type the values 90 and 100. These are percentages of the target: below 90% is red, 90% to below 100% is yellow, 100% or more is green.
- Select icon style: the traffic lights, symbols or arrows.
- Optionally click Descriptions to add text for the KPI, its value, status and target.
- Click OK. In the PivotTable Fields pane,
Revenuenow shows a traffic-light icon. Expand it to see Value, Goal and Status.
Tick all three and put 'Calendar'[Month] on rows with a Year slicer set to 2026:
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Month | Revenue (Value) | Target (Goal) | % of Target | Status |
| 2 | Jan | 2320 | 1,045.0 | 222.0% | Green |
| 3 | Feb | 567 | 613.8 | 92.4% | Yellow |
| 4 | Mar | 1140 | 2,090.0 | 54.5% | Red |
| 5 | Apr | 950 | 154.0 | 616.9% | Green |
| 6 | Grand Total | 4977 | 3,902.8 | 127.5% | Green |
KPI in a PivotTable, months Jan–Apr 2026. Status appears as traffic-light icons; % of Target added as a separate measure for checking.
January more than doubled its target: 2,320 against 950 × 1.1 = 1,045.0. February reached 92.4% of target, inside the yellow band. March fell far short, because March 2025 contained a large laptop order. The Grand Total compares the four months together and is green. To show the percentage itself, create an ordinary measure: % of Target := DIVIDE ( [Revenue], [Revenue Target] ).
Part 2: Hierarchies
A hierarchy is a named, ordered list of columns from one table, such as Category › Product. When a user drags the hierarchy into Rows, all levels arrive in the right order, with expand and collapse buttons. Hierarchies are especially valuable for dates (Year › Quarter › Month › Date) and geography (Country › Region › City).
Creating a hierarchy
- Open Power Pivot › Manage and switch to Home › View › Diagram View.
- In the Products box, click
Category, then Ctrl+clickProduct. - Right-click one of the selected columns and choose Create Hierarchy. (Or click the Create Hierarchy icon in the top-right corner of the table box and drag the columns into it.)
- Rename the hierarchy, for example to
Product Hierarchy. Check the level order: Category must be above Product; drag levels to reorder them. - Repeat in the Calendar table with Year, Quarter, Month and Date for a
Date Hierarchy.
RELATED calculated column first (only on small dimension tables), or simply drag the two fields to Rows separately.Once the hierarchy works, hide the separate Category and Product columns from client tools (right-click › Hide from Client Tools) if you want users to use only the hierarchy. The hierarchy keeps working after the columns are hidden.
Using a hierarchy in a PivotTable
- Drag
Product Hierarchyinto Rows. Use the + and − buttons, or PivotTable Analyze › Active Field › Expand Field / Collapse Field. - With a cell selected, PivotTable Analyze › Active Field › Drill Down replaces the current level with the next one, and Drill Up goes back. These buttons are available only for PivotTables on the Data Model.
- The Quick Explore magnifier that appears when you select a cell lets you drill into any other field from that item.
A measure that knows its level
A useful companion to a hierarchy is a percent-of-parent measure that changes its denominator depending on the level being shown. ISFILTERED tells you whether a column is directly filtered in the current cell:
% of Parent :=
SWITCH (
TRUE (),
ISFILTERED ( Products[Product] ),
DIVIDE ( [Revenue], CALCULATE ( [Revenue], ALL ( Products[Product] ) ) ),
ISFILTERED ( Products[Category] ),
DIVIDE ( [Revenue], CALCULATE ( [Revenue], ALL ( Products[Category] ) ) ),
1
)| A | B | C | D | |
|---|---|---|---|---|
| 1 | Category | Product | Revenue | % of Parent |
| 2 | Accessories | 745 | 11.2% | |
| 3 | Keyboard | 385 | 51.7% | |
| 4 | Mouse | 360 | 48.3% | |
| 5 | Computers | 4950 | 74.5% | |
| 6 | Laptop | 2850 | 57.6% | |
| 7 | Tablet | 2100 | 42.4% | |
| 8 | Displays | 945 | 14.2% | |
| 9 | Monitor | 945 | 100.0% | |
| 10 | Grand Total | 6640 | 100.0% |
Product Hierarchy in Rows, fully expanded (first Sales table of the course).
Monitor is 100% of Displays because it is the only display; Displays itself is 14.2% of the total 6,640. The test order matters: on a Product row both Product and Category are filtered, so Product must be tested first. Newer DAX versions offer ISINSCOPE, which is designed precisely for hierarchy levels; ISFILTERED works in every version that has Power Pivot, provided no slicer filters the Product column.
Perspectives and default field sets
Two more presentation features live on the Advanced tab of the Power Pivot window (switch on File › Switch to Advanced Mode if it is hidden). Perspectives define named subsets of tables, columns, measures and KPIs, for example a Sales Manager view; users pick one at the top of the PivotTable Fields pane. Default Field Set chooses which fields are added automatically when a user clicks a table name in Power View-style tools. Both are optional polish for large models.
Check yourself
1. What are the three parts of a Power Pivot KPI?
A KPI shows the value, its goal and a status.
2. With thresholds 90 and 100, what status does 95% of target get?
Between 90% and 100% is the middle band.
3. Can a hierarchy combine Customers[Region] and Products[Category]?
Hierarchies are defined within a single table.
4. Where do you create a hierarchy?
Hierarchies are built in Diagram View.
5. Why test ISFILTERED ( Products[Product] ) before ISFILTERED ( Products[Category] )?
SWITCH returns the first TRUE condition.