You are currently viewing Understanding Dimension Types in Power BI

Understanding Dimension Types in Power BI

When designing a Microsoft Power BI semantic model, understanding dimension types is important for creating efficient and meaningful data models.

This guide defines key dimension types, explains their relevance, and walks through a common scenario to identify the correct dimension type.

Dimension Types in Power BI

Dimension Types in Power BI

There are 4 dimensions types in Power BI as the following:

  1. Degenerate Dimension
  2. Junk Dimension
  3. Outrigger Dimension
  4. Role-Playing Dimension

1) Degenerate Dimension

A degenerate dimension arises when a fact table includes attributes that do not have their own dimension table.

  • Example: An invoice number stored directly in the fact table without linking to a dimension table.

2) Junk Dimension:

A junk dimension combines unrelated, low-cardinality attributes into a single table to simplify the model.

  • Example: Combining flags like IsPromotional and IsDiscounted into one dimension.

3) Outrigger Dimension:

An outrigger dimension is a secondary dimension table linked to another dimension rather than directly to a fact table.

  • Example: A โ€œLocationโ€ dimension connected to an โ€œEmployeeโ€ dimension but not directly to the fact table.

4) Role-Playing Dimension:

A role-playing dimension can serve multiple purposes in the same model by creating relationships with different columns in a fact table.

  • Example: A date table used for OrderDate, ShipDate, and ReturnDate.

Scenario: Dimension Types in Power BI

You have a Power BI semantic model containing two tables:

  1. DimDate โ€“ The main date table in the model.
  2. FactSales โ€“ A fact table containing data about sales orders.

In this model, FactSales has three relationships with DimDate:

  • Active Relationship: Between FactSales[OrderDate] and DimDate[Date].
  • Inactive Relationships:
    • Between FactSales[ShipDate] and DimDate[Date].
    • Between FactSales[ReturnDate] and DimDate[Date].

The goal is to determine the type of dimension that DimDate represents in this scenario.

What Type of Dimension is DimDate?

The correct answer is: Role-Playing Dimension.

Why DimDate is a Role-Playing Dimension

A role-playing dimension is a single dimension table that can act in different โ€œrolesโ€ within the same data model.

These roles are determined by establishing multiple relationships between the dimension table and the fact table. Only one of these relationships can be active at a time, while the others remain inactive.

How DimDate Functions in This Scenario

  • Active Relationship: Links the primary FactSales[OrderDate] to DimDate[Date] to filter or aggregate data based on the order date.
  • Inactive Relationships:
    • FactSales[ShipDate] to DimDate[Date]: Used to analyze data based on shipping dates, requiring explicit activation.
    • FactSales[ReturnDate] to DimDate[Date]: Used to analyze data based on return dates, also requiring explicit activation.

Activating Relationships in Power BI

Inactive relationships can be activated temporarily using DAX (Data Analysis Expressions) functions like:

DAX Formula Example:

Sales by Ship Date = CALCULATE( SUM(FactSales[SalesAmount]), USERELATIONSHIP(FactSales[ShipDate], DimDate[Date]) )

This flexibility allows users to switch between roles dynamically during analysis without altering the core model structure.

Why Other Dimension Types Do Not Apply

  1. Degenerate Dimension:
    • Not applicable because DimDate is not stored in the FactSales table but exists as a separate table.
  2. Junk Dimension:
    • Not applicable because DimDate is not a collection of unrelated attributes but a structured date table.
  3. Outrigger Dimension:
    • Not applicable because DimDate is directly linked to FactSales, not through another dimension.

Conclusion

In this Power BI scenario, DimDate is a role-playing dimension because it serves multiple purposes (OrderDate, ShipDate, ReturnDate) within the FactSales table.

By understanding and leveraging role-playing dimensions, you can create efficient and flexible data models tailored to complex analytical requirements.

References
  1. Role-Playing Dimensions in Power BI โ€“ Microsoft Documentation
  2. DAX USERELATIONSHIP Function โ€“ Microsoft Documentation
  3. Understanding Dimension Types in Data Modeling โ€“ SQLBI
See Also

Mohamed El-Qassas

Mohamed El-Qassas is a Microsoft Most Valuable Professional (MVP), Microsoft Certified Trainer (MCT), SharePoint Stack Exchange (StackOverflow) Moderator, Microsoft QnA Moderator, C# Corner MVP, Microsoft TechNet Wiki Judge, Blogger, Speaker, and Solutions Architect with +16 years of experience in SharePoint, Project Server, Microsoft Teams, Microsoft 365, and Power Platform.