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 a very simple DAX funtion as below which takes 576 MS to compute. How do i make it even better
I don't have a sample model to test this one but try this:
=
CALCULATE (
SUM ( Table1[SumCol] ),
Table1[Date] = MAX ( Table1[Date] ),
Table1[ColA] = 1,
Table1[ColB] = 2,
Table1[ColC] = "A",
Table1[ID1] = SELECTEDVALUE ( Table2[ID1] ),
Table1[ID2] = SELECTEDVALUE ( Table2[ID2] )
)
This articles goes into the detail of optimizing multiple filters within CALCULATE.
https://www.sqlbi.com/articles/specifying-multiple-filter-conditions-in-calculate/
Its the same formula that i have currently. What is the change in your suggetion?
Each filterargument has its own column. Yours used &&. The formula I suggested doesnt.
Hi @sathishsam,
You can try to use the following measure formula if it helps with your scenario:
formula =
VAR preFiltered =
CALCULATETABLE (
Table1,
FILTER (
ALLSELECTED ( Table1 ),
Table1[Date] = MAX ( Table1[Date] )
&& Table1[ColA] = 1
&& Table1[ColB] = 2
&& Table1[ColC] = "A"
)
)
VAR idList =
INTERSECT ( VALUES ( Table2[ID1] ), VALUES ( Table2[ID2] ) )
RETURN
SUMX ( FILTER ( preFiltered, [ID1] IN idList ), [SumCol] )
In addition, you can also take a look at following document about optimize the performance:
Improve Power BI Performance by Optimizing your DAX | by MAQ Software | MAQ Software | Medium
Regards,
Xiaoxin Sheng
Thank you for the time.
I tried your suggetions and it didn't help much, it increased the timings. See below
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 |
|---|---|
| 97 | |
| 74 | |
| 50 | |
| 49 | |
| 44 |