In Data Analytics eXpressions (DAX), when dealing with extensive tables in Power BI, one should consider the following advantages:
Refrain from Excessive Use of SUMX and FILTER: Directly operating on large tables with row-wise calculations, such as in functions like SUMX and FILTER, is not advisable. Such operations tend to make the queries sluggish. Instead, use better aggregation functions such as SUM, AVERAGE, etc., which are more about column consumers.
Refrain From Using DAX Calculated Columns: Where feasible, do not add DAX calculated columns. Add denormalized data during Power Query because its transformations are usually faster and do not contribute additional overhead during query time.
Make Sure to Use Aggregations: Aggregations are a powerful tool for enabling partial or complete totals and summaries of your data, especially when summarizing certain columns. Consider using Aggregated tables that contain less data in terms of number of rows. This approach can give you more control over your data analysis and speed up the process when dealing with large datasets.
Refine the Existing Relationships: If possible, consider designing relationships using integer keys instead of string keys. Integer keys can be processed differently and more quickly, especially if relationships are to be built between large tables.
Use Variables for Long Calculations: If your DAX expressions are long and have steps or segments, use variables and save the results in between. This method enhances the visual appeal of the code and reduces the number of calculations the engine needs to perform since variables are computed only once.
Disable Auto Date/Time: If you do not require this feature, switch off the “Auto Date/Time” option. It creates hidden data tables in the background for each date field, which may cause unnecessary bloat in the model and slow processing of large databases.
Enhance your DAX Queries with CALCULATE: Exercise caution when using CALCULATE, especially when it modifies the filter context to include other complex calculations that require row-by-row execution. For instance, there is no need to filter unnecessarily large fact tables; processing time can be saved by using CALCULATE with pre-aggregated measures.
If you follow these best practices, your analysis services DAX will be more efficient, thus allowing better performance when querying large data in Power BI.