Forum Discussion
Dashboard Report loading slowing while using semantic model Measures.
I have a report that is using semantic model. and in the report i crated a measure that is calling another measure using switch condition which is taking time is this a good practice, please suggest and also let me know how to use measures for good performance.
2 Replies
- rohit1991Super User
Hi , hope this information helps 🙂 ;
Using a measure that calls another measure through a SWITCH condition can lead to performance issues, especially in complex models or large datasets. Here are some recommendations:
Optimize the Measure Logic: Avoid deeply nested measures. Instead, simplify logic by precomputing results or restructuring the model.
Filter Context: Ensure the SWITCH statement avoids evaluating too many filters. Minimize the data processed by each condition.
Aggregations: Leverage pre-aggregated data or summarized tables to reduce calculation overhead.
Use Variables: Define calculations in variables within measures to avoid recalculating the same logic multiple times.
Test Alternatives: Replace SWITCH with calculated columns or parameters if dynamic logic isn’t essential at runtime.
Performance Analyzer: Use Power BI's Performance Analyzer to identify slow-performing measures and adjust accordingly.
- danextianSuper User
Hi devaj123
Whether that is a good practice, really depends. If you are using direct query to a semantic model then expect some delays. DQ after all is not as fast as import. That aside, it could be the measures themselves used in switch that have problems. You may be filtering a table when you're supposed to filter just a column or columns or you're using iterator functions on high cardinality virtual tables.