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.

Advanced 18 min read

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%:

DAX
Revenue := SUM ( Sales[Amount] )
Revenue LY := CALCULATE ( [Revenue], SAMEPERIODLASTYEAR ( 'Calendar'[Date] ) )
Revenue Target := [Revenue LY] * 1.1
The target must exist as a measure before you create the KPI.

Creating the KPI

  1. Choose Power Pivot › Calculations › KPIs › New KPI… (or right-click the Revenue measure in the Calculation Area and choose Create KPI).
  2. KPI base field (value): Revenue.
  3. Define target value: choose Measure and pick Revenue Target. (Choose Absolute value for a fixed number such as 2,000.)
  4. 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.
  5. Select icon style: the traffic lights, symbols or arrows.
  6. Optionally click Descriptions to add text for the KPI, its value, status and target.
  7. Click OK. In the PivotTable Fields pane, Revenue now 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:

ABCDE
1MonthRevenue (Value)Target (Goal)% of TargetStatus
2Jan23201,045.0222.0%Green
3Feb567613.892.4%Yellow
4Mar11402,090.054.5%Red
5Apr950154.0616.9%Green
6Grand Total49773,902.8127.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] ).

Note. KPI status thresholds are fixed numbers. If you need more complex rules (different thresholds per region, or a status based on the trend), build a measure that returns −1, 0 or 1 and add conditional formatting with Home › Conditional Formatting › Icon Sets on the PivotTable values instead.
Tip. Edit a KPI later with Power Pivot › KPIs › Manage KPIs. Deleting the KPI does not delete the base or target measures.

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

  1. Open Power Pivot › Manage and switch to Home › View › Diagram View.
  2. In the Products box, click Category, then Ctrl+click Product.
  3. 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.)
  4. Rename the hierarchy, for example to Product Hierarchy. Check the level order: Category must be above Product; drag levels to reorder them.
  5. Repeat in the Calendar table with Year, Quarter, Month and Date for a Date Hierarchy.
Watch out. All levels of a hierarchy must come from the same table. You cannot build Customers[Region] › Products[Category]. If you need levels from different tables, bring the column across with a 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 Hierarchy into 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:

DAX
% 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
)
Product rows: share of category. Category rows: share of the total. Grand total: 100%.
ABCD
1CategoryProductRevenue% of Parent
2Accessories74511.2%
3Keyboard38551.7%
4Mouse36048.3%
5Computers495074.5%
6Laptop285057.6%
7Tablet210042.4%
8Displays94514.2%
9Monitor945100.0%
10Grand Total6640100.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?

2. With thresholds 90 and 100, what status does 95% of target get?

3. Can a hierarchy combine Customers[Region] and Products[Category]?

4. Where do you create a hierarchy?

5. Why test ISFILTERED ( Products[Product] ) before ISFILTERED ( Products[Category] )?