If the data model refresh in Power BI takes too long, follow the methods below, which include using custom M or DAX codes.
1. Use Power Query to investigate the performance of Data Models
- Load Data in Parts: Load a smaller portion of data first and see whether the issue is attributed to volume or complexity.
- Equipment Review: Disable each transformation step in Power Query to Net one by one. This can help identify which processes take longer. Where applicable, enhance the efficiency of queries through the use of Tables. Buffer and cut the steps performed where they are not necessary.
2. Improving DAX calculations
- Check on Dependencies: Use DAX Studio to look for measure dependencies and eliminate the ones that do not need to be calculated again.
- Make Use Of Variables: Utilize variables whenever possible in DAX measures, which improves the speed of storing intermediary results.
- Improve Relationships: Be sure to populate a model with correct relationships, avoiding many-to-many types of relationships.
3. Manage Resource Consumption
- Performance Analyzer: Turn on the performance Analyst tool within Power BI to find any slow visuals.
- Of Review Resources: Observe CPU and Memory activity when refreshes are in progress, especially in Power BI Premium. This includes resource checking.
4. Best Practices for a Refresh
- Avoid Full Refresh Strategies: In large datasets, it is possible to set incremental refresh to avoid excessive processing times.
- Power BI dataflows: Implement ETL within Power BI dataflows to lessen the report's load and make the refresh processes much faster.
Applying these strategies will help one diagnose the reasons behind the slowness of the data model refresh in Power BI and improve performance.