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
Syndicate_Admin
Administrator
Administrator

Is it possible to generate a calculation loop?

Good morning, could you please help me with generating a calculated column which generates a calculation loop

The next expression is the one I need to generate as a loop
For i = 1 To VR
Period = Cant_Cuotas - VR+ i
Amortizacion_Capital = PPmt(Rate, Period, Cant_Cuotas, Capital) * -1
Next i
End Function
The data in my table

CreditNumberCant_CuotarateCapitalVR
11111212010.00011
22221012015.0008
33331512225.000012
5 REPLIES 5
Syndicate_Admin
Administrator
Administrator

What I need is the loop that takes out the difference between VR and ODDS AMOUNT and adds up the quota amount taken from the difference obtained previously.

CreditNumberCant_CuotaCapitalVR
11111210.00011
22221015.0008
33331525.000012

I don't see an ODDS AMOUNT column.

Syndicate_Admin
Administrator
Administrator

What I need is to calculate the "Present value" of some operations which I need to perform a loop calculation according to the number of quotas that the operation has, to be more specific I can attach the macro with which that calculation was made in excel.

Function Calculo_VA_FINMES(Cant_Cuotas, Capital, Vida_Remanente, Valor_Cuota, Tasa, Primer_Vencimiento, Fecha_Venta, tasa_P) As String
Amortizacion_Capital = 0
Cycle = Vida_Remanente
V_act = 0
days = 0
days = Primer_Vencimiento - Fecha_Venta
sum = 0
Tasa_P_cal = tasa_P / 100 * 1.21 / 365 * 30

For i = 1 To Ciclo
Periodo = Cant_Cuotas - Vida_Remanente + i

Amortizacion_Capital = PPmt(Tasa_P_cal, Period, Cant_Cuotas, Capital) * -1

Interes_S_IVA = (Valor_Cuota - Amortizacion_Capital) / 1.21

cuota_S_IVA = Amortizacion_Capital + Interes_S_IVA

V_act = cuota_S_IVA * (1 + (Tasa * 30 / 365)) ^ -(dias / 30)

The number = suma + V_act

Fecha_Vencimiento = WorksheetAction.EoMonth(Primer_Vencimiento, i)

What I need is to know how I could reconcile that looping calculation of the FOR expression since I have the rest of the data in columns




Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

lbendlin
Super User
Super User

This should be possible with PRODUCTX.  What is your expected outcome?

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.