Dimension Table in Power BI: Definition and Usage
dimension table in Power BI is a table that stores descriptive information about business entities, like customers or products. It helps organize and filter data in reports by connecting to fact tables through keys.How It Works
Think of a dimension table as a detailed address book for your data. It holds descriptive details about things you want to analyze, such as customer names, product categories, or dates. These details help you understand and slice your data in meaningful ways.
In Power BI, dimension tables connect to fact tables, which contain the numbers or measurements like sales or quantities. The connection happens through a key, like a customer ID, linking the descriptive info to the actual data. This setup lets you filter and group your reports easily, like seeing sales by product or by region.
Example
This example shows a simple dimension table for products with IDs and names, and a fact table with sales data linked by ProductID.
ProductDimension = DATATABLE(
"ProductID", INTEGER,
"ProductName", STRING,
{
{1, "Laptop"},
{2, "Smartphone"},
{3, "Tablet"}
}
)
SalesFact = DATATABLE(
"SaleID", INTEGER,
"ProductID", INTEGER,
"Quantity", INTEGER,
{
{101, 1, 5},
{102, 2, 3},
{103, 1, 2},
{104, 3, 4}
}
)
TotalQuantity = SUM(SalesFact[Quantity])When to Use
Use dimension tables when you want to organize your data by categories or descriptive details. For example, if you have sales data, dimension tables can hold information about customers, products, or dates. This helps you create reports that show sales by product type, region, or time period.
Dimension tables are essential in star schema data models, which improve report speed and clarity. They make filtering and grouping data easier and more efficient in Power BI dashboards.
Key Points
- Dimension tables store descriptive data about business entities.
- They connect to fact tables using keys to relate details to measurements.
- They help filter, group, and slice data in reports.
- Dimension tables improve data model clarity and performance.