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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors