Just like hierarchies in SSAS, hierarchies in PowerPivot for Excel 2013 provides a very convenient way to let you group data through different layers. Today we will use date dimension to demonstrate how to create hierarchies in PowerPivot.
First of all, you need to be in the Diagram View of the PowerPivot Window. Click Diagram View button under Home Tab.
Create Hierarchies
Select the table you would like to build hierarchies in. Here we choose DimDate table. Then click the “Create Hierarchies” button on the upper right corner of the table. After renaming the hierarchy you can drag the fields from the table down to the hierarchy that was just created. An alternative is to select a column first and then right click the column > Create Hierarchies.
Add Hierarchies
Right click the column that you would like to add to a hierarchy. A column can only be in one hierarchy. If a column already exists in a hierarchy, there won’t have an option to “Add to Hierarchy”.
If you would like to add a column from another table, you need to use RELATED DAX function to add columns from one table to another table. Before you can add columns, you must create a relationship between these tables.
Adjust Hierarchy Levels
If you would like to adjust the levels between hierarchies, right click any one and move up or down, or remove.
After hierarchies are created, you can directly drag it to PivotTable Fields just as columns.
No comments:
Post a Comment