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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
mojain
Frequent Visitor

Revised principle amount calculation Urgent

Hi Community Member,


Tagging @amitchandak , @Ritaf1983, , @Idrissshatila , @Daniel29195  

 

I have come up with a problem with creating a calculated column in Power BI for calculation of reviesd amount.

Below is the table with the final amount I want and Its excel calculation in side column.

"
Here is the condition.

for 1st row i.e. index = 0 Then amount column valve w.r.t. index =0.
for 2nd row i.e. index = 1 then Final Amount column valve w.r.t. index =0. * ROI_2 of index = 1
for 3rd row i.e. index = 2 then Final Amount column valve w.r.t. index =1. * ROI_2 of index = 2
for 4th row i.e. index = 3 then Final Amount column valve w.r.t. index =2. * ROI_2 of index = 3
and so on.

"

please help me with DAX or Power Query solution.



IndexProductamountRateFinal AmountExcel calculation for Final Amount
0A  19964770.4109589  1.00325479452055  19964770.4109589  E2
1A  19964770.4109589  1.01331506849315  20230602.6964308  D3*E2
2A  19964770.4109589  1.01346301369863  20502967.5776644  D4*E3
3A  19964770.4109589  1.01361095890411  20782032.6267763  D5*E4
4A  19964770.4109589  1.01361095890411  21064896.0188032  D6*E5
5A  19964770.4109589  1.01331506849315  21345376.5520947  D7*E6
6A  19964770.4109589  1.01346301369863  21632749.649018  D8*E7
7A  19964770.4109589  1.01361095890411  21927192.1154736  D9*E8
8A  19964770.4109589  1.01361095890411  22225642.2262399  D10*E9
9A  19964770.4109589  1.01331506849315  22521578.1747865  D11*E10
10A  19964770.4109589  1.01346301369863  22824786.4902684  D12*E11
11A  19964770.4109589  1.01361095890411  23135453.7211825  D13*E12
12A  19964770.4109589  1.01361095890411  23450349.4310095  D14*E13
13A  19964770.4109589  1.01346301369863  23766061.8066368  D15*E14
14A  19964770.4109589  1.01346301369863  24086024.6223021  D16*E15
15A  19964770.4109589  1.01361095890411  24413858.5135996  D17*E16
16A  19964770.4109589  1.01361095890411  24746154.5385189  D18*E17
17A  19964770.4109589  1.01331506849315  25075651.2811414  D19*E18
18A  19964770.4109589  1.01346301369863  25413245.1178415  D20*E19
19A  19964770.4109589  1.01361095890411  25759143.7527605  D21*E20
20A  19964770.4109589  1.01361095890411  26109750.3997844  D22*E21
0B  19964770.4109589  1.00325479452055  19964770.4109589  E23
1B  19964770.4109589  1.01331506849315  20230602.6964308  D24*E23
2B  19964770.4109589  1.01346301369863  20502967.5776644  D25*E24
3B  19964770.4109589  1.01361095890411  20782032.6267763  D26*E25
4B  19964770.4109589  1.01361095890411  21064896.0188032  D27*E26
5B  19964770.4109589  1.01331506849315  21345376.5520947  D28*E27
6B  19964770.4109589  1.01346301369863  21632749.649018  D29*E28
7B  19964770.4109589  1.01361095890411  21927192.1154736  D30*E29
8B  19964770.4109589  1.01361095890411  22225642.2262399  D31*E30
9B  19964770.4109589  1.01331506849315  22521578.1747865  D32*E31
10B  19964770.4109589  1.01346301369863  22824786.4902684  D33*E32
11B  19964770.4109589  1.01361095890411  23135453.7211825  D34*E33
12B  19964770.4109589  1.01361095890411  23450349.4310095  D35*E34
13B  19964770.4109589  1.01346301369863  23766061.8066368  D36*E35
14B  19964770.4109589  1.01346301369863  24086024.6223021  D37*E36
15B  19964770.4109589  1.01361095890411  24413858.5135996  D38*E37
16B  19964770.4109589  1.01361095890411  24746154.5385189  D39*E38
17B  19964770.4109589  1.01331506849315  25075651.2811414  D40*E39
18B  19964770.4109589  1.01346301369863  25413245.1178415  D41*E40
19B  19964770.4109589  1.01361095890411  25759143.7527605  D42*E41
20B  19964770.4109589  1.01361095890411  26109750.3997844  D43*E42
2 REPLIES 2
Sahir_Maharaj
Super User
Super User

Hello @mojain,

 

Can you please try the following :

Final Amount = 
VAR CurrentIndex = YourTable[Index]
VAR CurrentRate = YourTable[Rate]
VAR BaseAmount = YourTable[amount]
VAR PreviousAmount = 
    CALCULATE(
        MAX(YourTable[Final Amount]), 
        FILTER(
            YourTable, 
            YourTable[Index] = CurrentIndex - 1
        )
    )
RETURN
IF(
    CurrentIndex = 0, 
    BaseAmount,
    PreviousAmount * CurrentRate
)

Hope this helps.


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ About: https://sahirmaharaj.com/about.html
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

Hi @Sahir_Maharaj ,
Thank you so much for the solution, but in my case I am getting an error as below with DAX.

 

Error :- A circular dependency was detected: Data (5)[Final Amount].


Please help me with the solution.
In my case I have to use the previous value from the same column and it would be ok as well if M query is provided.

 

 

Final Amount =
VAR CurrentIndex = 'Data (5)'[Index]
VAR CurrentRate = 'Data (5)'[ROI_2]
VAR BaseAmount = 'Data (5)'[Amount]
VAR PreviousAmount =
    CALCULATE(
        MAX('Data (5)'[Final Amount]),
        FILTER('Data (5)',
          'Data (5)'[Index] = CurrentIndex - 1
        )
    )
RETURN
IF(
    CurrentIndex = 0,
    BaseAmount,
    PreviousAmount * CurrentRate
)



Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.

Top Solution Authors