The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
Month | Total Spend planned (TSP) | Already engaged for payment (AEFP) | Remain to engage (RTE) |
1 | 200 | 180 | 20 |
2 | 100 | 80 | 20 |
3 | 150 | 30 | 120 |
4 | 100 | 10 | 90 |
5 | 200 | 5 | 195 |
6 | 50 | 50 | |
total | 800 | 305 | 495 |
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
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 valid
User | Count |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
31 | |
15 | |
12 | |
7 | |
6 |