Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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.
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 |
|---|---|
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 21 | |
| 10 | |
| 8 | |
| 8 |