Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi,
Thanks for your help in advance!
Some of my visuals/tables are taking ~1 minute to load, how can I reduce the loading time?
Maximum time is taken by line chart by week.
I have similar structured DAX as follows to switch between weekly, YTD, LTM, followed by respective YoYs. An example is shown below:
Current time period DAX:
sales_current =
Previous time period DAX:
sales_ly =
var sales_wk_prev = CALCULATE( [SALES_SUM], SALES[WEEK] = wk, SALES[YEAR] = prev_yr )
var sales_ytd_prev = CALCULATE([SALES_SUM], SALES[YEAR] = prev_yr, SALES[WEEK] <= wk, SALES[MONTH] <= mn )
var sales_ltm_prev = CALCULATE( [SALES_SUM] , SALES[WEEK_CONSECUTIVE] >= prv_wknm - 52, SALES[WEEK_CONSECUTIVE] <= prv_wknm )
return
SWITCH( TRUE(),
SELECTEDVALUE(SALES_TIME_PERIODS[TIME_PERIODS])= "Week", FIXED(sales_wk_prev,0,0),
SELECTEDVALUE(SALES_TIME_PERIODS[TIME_PERIODS])= "YTD", FIXED(sales_ytd_prev,0,0),
SELECTEDVALUE(SALES_TIME_PERIODS[TIME_PERIODS])= "LTM", FIXED(sales_ltm_prev,0,0) )
YoY:
yoy = ( sales_current - sales_ly ) / sales_ly
I have multiple KPIs and YoYs (~20 columns) in the matrix which is taking a lot of time to load. Maximum time is taken by a line chart by week which has 2 KPIs. The backend fact data consists of 12million+ rows.
Will adding filter( all( ..... ) .... .... ) in calculate help? or any other step?
Kindly help me to reduce the loading time. Please let me know if more information is needed.
Thanks
Solved! Go to Solution.
Before digging too far into the DAX, I'd recommend looking up and researching field parameters for Power BI: Use report readers to change visuals (preview) - Power BI | Microsoft Learn. It looks like this could solve many problems and simplify the DAX you've made if you implement some date field parameters (Month, Year, Week, etc.). This way, you don't have to calculate each range individually and can just do a single calculation.
Also, try to use the FILTER function with AND or OR to help reduce execution time. var sales_ltm_prev can be re-written as:
CALCULATE(
[SALES_SUM] ,
FILTER(
VALUES(
SALES[WEEK_CONSECUTIVE]
),
AND(
SALES[WEEK_CONSECUTIVE] >= prv_wknm - 52,
SALES[WEEK_CONSECUTIVE] <= prv_wknm
)
)
)
which could help speed up that query significantly.
Before digging too far into the DAX, I'd recommend looking up and researching field parameters for Power BI: Use report readers to change visuals (preview) - Power BI | Microsoft Learn. It looks like this could solve many problems and simplify the DAX you've made if you implement some date field parameters (Month, Year, Week, etc.). This way, you don't have to calculate each range individually and can just do a single calculation.
Also, try to use the FILTER function with AND or OR to help reduce execution time. var sales_ltm_prev can be re-written as:
CALCULATE(
[SALES_SUM] ,
FILTER(
VALUES(
SALES[WEEK_CONSECUTIVE]
),
AND(
SALES[WEEK_CONSECUTIVE] >= prv_wknm - 52,
SALES[WEEK_CONSECUTIVE] <= prv_wknm
)
)
)
which could help speed up that query significantly.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
12 | |
11 | |
10 | |
9 | |
8 |