DEV Community

Cover image for Schemas and Data Modelling in Power BI
Steve Andrew
Steve Andrew

Posted on

Schemas and Data Modelling in Power BI

Microsoft Power BI is an interactive data visualization software product developed by Microsoft with a primary focus on businness intelligence.
Power BI consists of four main areas:

  1. Ribbon (Top Toolbar)
  2. Fields pane (Right SideBar)
  3. Visualizations Pane (Right SideBar)
  4. Report View,Data View and Model View (Bottom)

In this article, i will share more information about schemas and data modelling.

** What is a Schema?**
It refers to _the structure and organization of data within a data model.Schemas define how data is connected and related within the model, influencing the efficiency and performance of data queries and reports.

Types of Schemas.

  1. Star Schema 2.Snowflake Schema

Star Schema,how it works.
A star schema is made up of a central fact table with multiple dimensions table branching off of this fact table, much like the appearance of a star.

Benefits for Power BI
1.Query performance - star schema reduces joins from 10+ to 2-3 tables and is 5-10x faster query execution.
2.DAX simplicity - measures reference fact table,filters uses dimensions and clearer codes.
3.Star schema columnar storage compresses better than normalized.

Fact table: -mae up of values that can be summarised and aggregated as well as one or more keys that link to the dimension tables.Purpose of the key - make connections between tables.When handling large volumes of data,it is recommended for the keys to be numeric values rather than text strings, as this can improve the model perfomarmance.
Fct tables should be very narrow and include a few columns as possible.Any columns that describes the features of a dataset such as Product Name or Product Category,should be separated out of the fact table a process called normalization of data.Goal - is to avoid repetitiveness.

Dimensions Table : desribes the features of the data set logically grouped together.They should contain unique values for the features they are describing and the columns are responsible for filtering or grouping of the data in Power BI.

2.Snowflake Schema
Normalized dimensions ideal for complex hierarchies.The dimension tables are further divided especially if a feature has any further categories or sub counties.
Example: Given a data set with Product tables that contain Product ID,Product Name and Product Category.In a snowflake schema the Products table will only contain Product ID and Product Name while the Product Category would firther be divided out into its own table containing Procuct Categoty ID and Product Category.

Data Modelling
Is the process of creating visual representation of the connections between data structures, with information about the individual attributes contained within those data structures.

Good data modelling practices are very important for building Power BI reports that are optimized for performance and can scale as needed.

Top comments (0)