Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi PBI Community,
I am trying to figure out why my DAX query is really slow when i have replicated my solution into a new file?
Here is the output from the performance analyser for the fast version
// DAX Query Speed 6154 FAST DEFINE VAR __DS0FilterTable = TREATAS({"2019"}, '+ C A L E N D A R'[Fiscal Year]) VAR __DS0Core = SUMMARIZECOLUMNS( 'Income Statement Template'[Row Index], 'Income Statement Template'[Income Statement Items], __DS0FilterTable, "Selected_Year_Actuals", 'Income Analysis'[Selected Year Actuals], "Selected_Year_Previous_Actuals", 'Income Analysis'[Selected Year Previous Actuals], "TY_vs_PY_Actuals", 'Income Analysis'[TY vs PY Actuals], "TY_vs_PY_Actuals__", 'Income Analysis'[TY vs PY Actuals %] ) VAR __DS0PrimaryShowAll = ADDMISSINGITEMS( 'Income Statement Template'[Row Index], 'Income Statement Template'[Income Statement Items], __DS0Core, 'Income Statement Template'[Row Index], 'Income Statement Template'[Income Statement Items], __DS0FilterTable ) EVALUATE GROUPBY( __DS0PrimaryShowAll, "MinTY_vs_PY_Actuals__", MINX(CURRENTGROUP(), [TY_vs_PY_Actuals__]), "MaxTY_vs_PY_Actuals__", MAXX(CURRENTGROUP(), [TY_vs_PY_Actuals__]) ) EVALUATE TOPN( 501, __DS0PrimaryShowAll, 'Income Statement Template'[Row Index], 1, 'Income Statement Template'[Income Statement Items], 1 ) ORDER BY 'Income Statement Template'[Row Index], 'Income Statement Template'[Income Statement Items]
Here is the same Visual in a new file and the output of the performance is a lot slower
Here is the output from the Performance Analyser
// DAX Query Speed is 24915 SLOW DEFINE VAR __DS0FilterTable = TREATAS({"2019"}, 'Calendar'[Fiscal Year]) VAR __DS0Core = SUMMARIZECOLUMNS( 'Income Statement Template'[Row Index], 'Income Statement Template'[Income Statement Items], __DS0FilterTable, "Selected_Year_Actuals", 'Performance Analysis'[Selected Year Actuals], "Selected_Year_Previous_Acutals", 'Performance Analysis'[Selected Year Previous Acutals], "TY_vs_PY_Actuals", 'Performance Analysis'[TY vs PY Actuals], "TY_V_PY_Actuals__", 'Performance Analysis'[TY V PY Actuals %] ) EVALUATE TOPN( 501, ADDMISSINGITEMS( 'Income Statement Template'[Row Index], 'Income Statement Template'[Income Statement Items], __DS0Core, 'Income Statement Template'[Row Index], 'Income Statement Template'[Income Statement Items], __DS0FilterTable ), 'Income Statement Template'[Row Index], 1, 'Income Statement Template'[Income Statement Items], 1 ) ORDER BY 'Income Statement Template'[Row Index], 'Income Statement Template'[Income Statement Items]
In the slow version, I can see that the Evaluate TOPN function seems to be running a lot earlier than the fast version.
Can anyone advise why this is the case and what I can do to improve the speed to how the original is running?
Its got me stumped?
You may check if it is affected by the data model size.
Its a smaller data model. Does the query information supplied give any indications...and the queries look different too when extracted from the performance analyser
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
115 | |
100 | |
88 | |
69 | |
61 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |