Adding hierarchies
Another important option in tabular models is the ability to create hierarchies. To create a hierarchy of products, perform the following steps:
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.
Add a new column containing the following formula:
=RELATED(ProductSubcategory[EnglishProductSubcategoryName])
Right-click on the column and change the name to
Product Subcategory
.Add a second column that has the following definition:
=RELATED(ProductCategory[EnglishProductCategoryName])
Change the name of the column to
Product Category
.Switch to the Diagram view.
Click on the Create Hierarchy button in the top-right corner of the DimProduct table.
Name the hierarchy as
Product Categories
.Drag the Product Category attribute and drop it on the Product Categories hierarchy.
Drag the Product Subcategory attribute...