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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I have my measure working, but takes long time to calculate. I asusme its because they are calling each other...
My measure is: SUM(Fact[Hours]) / ([TotalH]* [FF])
TotalH:=
VAR selectedDays = ALLSELECTED('DimDate'[Date])
RETURN
CALCULATE(IF(SELECTEDVALUE(DimUser[Code]) ="A", SUM(DimStdDates[A_StandardHours])
,IF(SELECTEDVALUE(DimUser[Code]) ="B", SUM(DimStdDates[B_StandardHours])
,IF(SELECTEDVALUE(DimUser[Code]) ="C", SUM(DimStdDates[C_StandardHours])
,SUM(DimDate[DefaultStandardHours])))))),
FILTER('DimStdDates', DimStdDates[Date] IN selectedDays))
FF:=
DIVIDE(
'Calculations'[TotalH] * DISTINCTCOUNT(DimUser[Key])
-
CALCULATE(
SUM(Fact[Hours]),
FILTER(Fact, Fact[Type] = "f57"
)),
'Calculations'[TotalH]
* DISTINCTCOUNT(DimUser[Key])
)
It seems to be the DAX:
how can I spot the specific line taking the longest...
and it finishes like:
Hi @Anonymous ,
I recommend that you go to DAX studio or Performance Analyzer to check the time spent on DAX.
In addition, if your judgment condition is more than 5 times, it is recommended to use a switch instead of multiple if, which will not only make the code readable, but also reduce the CPU load.
Best Regards,
Xianda Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.