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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Recursive calculation with cumulated sums

Hello all,

I am struggling in Power Bi to compute the following formula (remain to engage)


RTE(m) = MAX [ sum[TSP] (m0 to m) - sum[AEFP] (m0 to m) -sum[RTE] (m0 to m-1) ; 0]

see example below

 

would you have any idea to solve this please ?

thank you for your support

regards

gen

 

MonthTotal Spend planned 
(TSP)
Already engaged for payment (AEFP)Remain to engage (RTE)
120018020
21008020
315030120
41001090
52005195
650 50
    
total800305495
2 REPLIES 2
AlexisOlson
Super User
Super User

From your example, it looks like you can simply define RTE = TSP - AEFP (or maybe MAX( TSP - AEFP, 0 ) ).

 

Recursion in DAX is problematic in general but often you can find non-recursive ways of doing the computation. Check out this post for more detail: https://stackoverflow.com/questions/52766022/recursion-in-dax

Anonymous
Not applicable

actually my example was a little bit easy... it happens that the planned revised is below the already engaged..
in this case I need the max to avoid further engagement and make sure that month after month my cumul is validCapture.PNG

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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