Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Deepesh_V95
Frequent Visitor

Slow measure performance with Earlier function

Hi Team,

 

I have a DAX measure in my report as shown below:

 

Paid Sum_Stop Loss = CALCULATE(SUM('ops tClmsAllClmLines'[ClaimNetPay]),FILTER('ops tClmsAllClmLines',CALCULATE(SUM('ops tClmsAllClmLines'[ClaimNetPay]),FILTER('ops tClmsAllClmLines','ops tClmsAllClmLines'[MemberID] = EARLIER('ops tClmsAllClmLines'[MemberID]))) >= [SL$-MinMeasure]))
 
The above measure outputs ClaimNetPay with the mentioned filter conditions and also with a condition where result >= [SL$-MinMeasure]
 
Here [SL$-MinMeasure] is a measure which outputs Minimum value from a different another column.
 
The issue here I suppose is that the Earlier function is causing this DAX measure to render very slowly when I checked it in performance analyzer, hence hampering report speed.
 
Can you please suggest if there is a way I can use any other function or write the formula in an optimized way?
 
Thanks in advance for help!
 
Cheers,
Deepesh 
3 REPLIES 3
Anonymous
Not applicable

Did you already try to make a calculated table with a calculation on 'ops tClmsAllClmLines'[MemberID]? Then replace 'ops tClmsAllClmLines'[MemberID] with the related value of that table.

v-alq-msft
Community Support
Community Support

Hi, @Deepesh_V95 

 

Based on my research, It is the measure [SL$-MinMeasure] that causes this DAX measure to render very slowly. The measure will be calculated many times during the 'Filter' iterator. I'd like to suggest you use a variable to keep the measure out of the calculation. You may modify it as below.

 

Paid Sum_Stop Loss = 
var x = [SL$-MinMeasure]
return
CALCULATE(
         SUM('ops tClmsAllClmLines'[ClaimNetPay]),
         FILTER(
                'ops tClmsAllClmLines',
                CALCULATE(
                          SUM('ops tClmsAllClmLines'[ClaimNetPay]),
                          FILTER(
                                'ops tClmsAllClmLines',
                                'ops tClmsAllClmLines'[MemberID] = EARLIER('ops 
                                tClmsAllClmLines'[MemberID])
                          )
                ) >= x
         )
)

 

 

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @v-alq-msft . I tried this approach but still it is taking same amount of time to render. Is there anything else or any approach I can try out?

 

Thank you!

Deepesh

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors