Chapter 12. Performance Tuning with DAX
In this chapter, I show how to create the necessary tables in DAX to support the performance tuning concepts from Chapter 8. The idea is to create additional tables that contain the data in an aggregated way. These additional tables increase your semantic model’s memory consumption in exchange for faster reports (less data has to be read to create the result of a query). For simpler aggregation tables, you can configure Power BI to automatically use the aggregation tables. For more complex scenarios, you need to add logic to your measures so they use the detailed or the aggregated table instead for their calculations. You can use the Performance Tuning.pbix file to follow along with the examples in this chapter.
Storage Mode
Analogously to calculated columns, calculated tables are always persisted in the data model and re-calculated during the refresh of the data model. With that said, calculated tables (written in DAX) are always in Import mode—independently of whether the source of the table expression is in DirectQuery or Import mode. You cannot add calculated tables in live connection mode.
Pre-Aggregating
You can group by one or more dimension columns and create aggregations on this aggregation level with the SUMMARIZECOLUMNS function’s help. In the first parameter(s), you provide column names for the dimensional values you want to group on.
For the combination of the values of these columns, the aggregation table is generated. These ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access