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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi all,
I am quite new for PowerBI. I would like to ask for help.
I made the PowerBI dashboard which reads the report slowly.
I assume that the below DAX affects the whole dashboard performance.
Is there any way to enhance this using VAR function?
Solved! Go to Solution.
Hi @sean_hong ,
You can try the following measure.
DAX_name =
var _a=SELECTEDVALUE(wbr[measure_type]) IN {"name1", "name2", "name3"}
var _b=IFERROR( SUM(table[measure1]), 0)
var _c=SELECTEDVALUE(wbr[measure_type]) IN {"name4", "name5", "name6"}
var _d=divide(sum(table[measure1]), sum(table[measure2]), 0)
var _e=SELECTEDVALUE(wbr[measure_type]) IN {"name7"}
var _f=IFERROR( CALCULATE(Table2[measure3]*100), 0)
var _g=SELECTEDVALUE(wbr[measure_type]) IN {"name8", "name9"}
var _h=divide( sum(table[measure1]),sum(table[measure2]), 0)*1000000
.....
var _result=
SWITCH(
TRUE()
, _a, _b
, _c, _d
, _e, _f
,_g , _h)
return _result
Please refer to the following document for more information.
Use variables to improve your DAX formulas - DAX | Microsoft Learn
Using Variables within DAX - (powerbi.tips)
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Fantastic!. It perfectly works. Thak you so much !!
Hi @sean_hong ,
You can try the following measure.
DAX_name =
var _a=SELECTEDVALUE(wbr[measure_type]) IN {"name1", "name2", "name3"}
var _b=IFERROR( SUM(table[measure1]), 0)
var _c=SELECTEDVALUE(wbr[measure_type]) IN {"name4", "name5", "name6"}
var _d=divide(sum(table[measure1]), sum(table[measure2]), 0)
var _e=SELECTEDVALUE(wbr[measure_type]) IN {"name7"}
var _f=IFERROR( CALCULATE(Table2[measure3]*100), 0)
var _g=SELECTEDVALUE(wbr[measure_type]) IN {"name8", "name9"}
var _h=divide( sum(table[measure1]),sum(table[measure2]), 0)*1000000
.....
var _result=
SWITCH(
TRUE()
, _a, _b
, _c, _d
, _e, _f
,_g , _h)
return _result
Please refer to the following document for more information.
Use variables to improve your DAX formulas - DAX | Microsoft Learn
Using Variables within DAX - (powerbi.tips)
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 93 | |
| 81 | |
| 73 | |
| 46 | |
| 35 |