Database Reference
In-Depth Information
Adding hierarchies
Another important option in tabular models is the ability to create hierarchies. To cre-
ate a hierarchy of products, perform the following steps:
1. First of all, you need to flatten the product's dimension; in the data warehouse,
this is a snowflake, but in the tabular model, you need to have a single table
containing all the attributes. Click on the
DimProduct
tab in the designer.
2. Add a new column containing the following formula:
=RELATED(ProductSubcategory[EnglishProductSubcategoryName])
3. Right-click on the column and change the name to
Product Subcategory
.
4. Add a second column that has the following definition:
=RELATED(ProductCategory[EnglishProductCategoryName])
5. Change the name of the column to
Product Category
.
6. Switch to the
Diagram
view.
7. Click on the
Create
Hierarchy
button in the top-right corner of the
DimProduct
table.
8. Name the hierarchy as
Product Categories
.
9. Drag the
Product Category
attribute and drop it on the
Product Categories
hierarchy.
10. Dragthe
Product Subcategory
attributeanddropitbelow
Product Category
in the
Product Categories
hierarchy.
11. Drop the
EnglishProductName
attribute below
Product Subcategory
.
The newly created hierarchy should look like the following:
Search WWH ::
Custom Search