Saving the Day from Delay Part 1
Optimizing your data model can be a daunting task. If you read the intro to this series, you know one of the most efficient and sustainable solutions to a bogged-down data model is to remove native date queries and use a date table. This post will dig into how and why this will speed up performance in both refreshes and in the online PBI service and how to make date and time keys.
The key to optimization is compression. An efficiently compressed data model is a lean, mean, query running machine. There are two types of compression – horizontal and vertical. Horizontal compression occurs on a row by row basis while vertical compression occurs column by column. Power BI uses the Veripaq Engine, a vertical compression model, to compress data inside the data model. While vertical is more CPU intensive, it is also more efficient as it finds the best option for compression based on the data type in the column (values/whole numbers are most efficient). Data mozart does an in-depth look on this process that I highly recommend reviewing if you have more questions (link at bottom of this post).
Vertical compression is significantly slower on date time columns than value columns. DateKeys are your best friend in compressing your data model because they allow you to capture vital date information but store it in a value format (the most optimal format – think whole number). Converting all your primary date fields to a DateKey will allow all calculations using that primary date field to run much faster as Vertipaq can process the requests more efficiently.
Next post we’ll cover making time and date keys in the Power Query Editor.
- ^ https://data-mozart.com/inside-vertipaq-compress-for-success/ (data-mozart.com)
- ^ https://github.com/AnytsirkGTZ/TimeTable_MCode/blob/main/MQuery%20Time (github.com)
- ^ Power BI: Data Model Optimization (www.sqlservercentral.com)
- ^ SQLServerCentral (www.sqlservercentral.com)
Source: Programming News