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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Aperszon
Frequent Visitor

depreciation/amortization schedule

Hello, 

 

I am trying to expand a cashflow. And is running out of ideas. 

 

I have amortizing schedule which works ok. I now want to expand it to also base it off straight line depreciation.

 

What I am trying to do is if [ProductID] = 0-1-0-1 then principal calculation should based on a straight line depreciation rather than on a amortizing basis for each period.
So in essence (Total Rentals - Residual ) / Periods. Interest would then just be difference between Rental and Principal. Residual is fixed at 250.

 

Where I am getting stuck is how to combine the two methods and switch the calculation when only this filter (0-1-0-1) is chosen and when all others use the declining interest.

 

Amortization table. 

 

 

 

 

Amortization Schedule = 
ADDCOLUMNS (
    ADDCOLUMNS (
        ADDCOLUMNS (
            SUMMARIZE (
                'Lease Details',
                'Calendar Date'[YearMonth], 
                [Lease ID ],
                [Present Value ],
                [Rent],
                "Beginning balance",
                    VAR PV =
                        CALCULATE (
                            SUM('Lease Details'[Present Value ]),
                            FILTER (
                                ALL ( 'Lease Details' ),
                                [Lease ID ] = SELECTEDVALUE ( 'Lease Details'[Lease ID ] )
                            )
                        )
                    VAR I = 0.0033
                    VAR Series =
                        SELECTEDVALUE ('Series New'[Series])
                    VAR Payment =
                        'Lease Details'[Rent]
                    VAR Result =
                        IF (
                            PV
                                * POWER ( 1 + I, Series - 1 )
                                - Payment
                                    * DIVIDE ( POWER ( 1 + I, Series - 1 ) - 1, I ) >= 0,
                            PV
                                * POWER ( 1 + I, Series - 1 )
                                - Payment
                                    * DIVIDE ( POWER ( 1 + I, Series - 1 ) - 1, I ),
                            0
                        )
                    RETURN
                        Result
            ),
            "Interest", [Beginning balance] * 0.0033
        ),
        "Ending balance",
            IF (
                [Beginning balance] - ( [Rent] - [Interest] ) >= 0,
                [Beginning Balance] - ( [Rent] - [Interest] ),
                0
            )
    ),
    "Principal",
    VAR Principal =
        IF([Rent] - [Interest] >= 0, [Rent] - [Interest], 0 )
        RETURN
        Principal
)

 

 

 

 

Base Data

 

Date Interest Discount Lease ID Present Value RentEst Present ValueEst RentMonth Count

1/1/20191.000-1-1-0259.14260259.142601
1/1/20191.000-2-0-0259.142600.0001
2/1/20190.990-1-1-0258.29260258.292602
2/1/20190.990-2-0-0258.292600.0002
3/1/20190.990-1-1-0257.86260257.862603
3/1/20190.990-2-0-0257.522600.0003
4/1/20190.990-1-1-0256.58260256.582604
4/1/20190.990-2-0-0256.582600.0004
4/1/20191.000-1-0-1388.713900.0004
5/1/20190.980-1-1-0255.75260255.752605
5/1/20190.980-2-0-0255.352600.0005
5/1/20190.990-1-0-1387.433900.0005
6/1/20190.980-1-1-0254.56260254.562606
6/1/20190.980-2-0-0254.892600.0006
6/1/20190.990-1-0-1386.153900.0006
7/1/20190.980-1-1-0254.05260254.052607
7/1/20190.980-2-0-0254.052600.0007
7/1/20190.990-1-0-1384.883900.0007
8/1/20190.970-1-1-0253.21260253.212608
8/1/20190.970-2-0-0253.212600.0008
8/1/20190.980-1-0-1383.613900.0008
9/1/20190.970-1-1-0252.38260252.382609
9/1/20190.970-2-0-0252.382600.0009
9/1/20190.980-1-0-1382.343900.0009
10/1/20190.970-1-1-0251.55260251.5526010
10/1/20190.970-2-0-0251.552600.00010
10/1/20190.980-1-0-1381.083900.00010
11/1/20190.960-1-1-0250.72260250.7226011
11/1/20190.960-2-0-0250.722600.00011
11/1/20190.970-1-0-1379.823900.00011
12/1/20190.960-1-1-0249.89260249.8926012
12/1/20190.960-2-0-0249.892600.00012
12/1/20190.970-1-0-1378.573900.00012
1/1/20200.960-1-1-0249.06260249.0626013
1/1/20200.960-2-0-0249.062600.00013
1/1/20200.970-1-0-1377.323900.00013
2/1/20200.950-1-1-0248.24260248.2426014
2/1/20200.950-2-0-0248.242600.00014
2/1/20200.960-1-0-1376.073900.00014
3/1/20200.950-1-1-0247.42260247.4226015
3/1/20200.950-2-0-0247.422600.00015
3/1/20200.960-1-0-1374.833900.00015
4/1/20200.950-1-1-0246.61260246.6126016
4/1/20200.950-2-0-0246.612600.00016
4/1/20200.960-1-0-1373.603900.00016
5/1/20200.950-1-1-0245.79260245.7926017
5/1/20200.950-2-0-0245.792600.00017

 

https://drive.google.com/file/d/1YXb78yhZsuzEl6xuWdNHFBKaQMcNbEga/view?usp=drive_link

 

2 REPLIES 2
lbendlin
Super User
Super User

You created a calculated table. That cannot be influenced by users interacting with slicers ( like selecting a Lease ID).  You would either have to add the straight line depreciation calculation to your static table,  and then use a measure to flip the result based on the Lease ID,  or you would need to compute everything dynamically in a measure.

 

Note - Your DAX code could use some refactoring, both for performance and readability.

That is fair enough. some improvements can defintely be done. and would be open to any suggestions.

 

this would definitely need to be acheived through a measure rather than table. Flipping the Principal and interest between the two could be done by something like this, same thing for the principal with slight variations. FYI just created two new columns for the OPL as you suggested above. 

Selected_Interest = 
VAR DEP = SUM('Amortization Schedule'[Rent]) - SUM('Amortization Schedule'[Capital OPL])
VAR Interest = SUM('Amortization Schedule'[Interest])

VAR Results = 
SWITCH(
    SELECTEDVALUE('Amortization Schedule'[Lease ID ]),
     "0-1-0-1",
        DEP,
            "0-1-1-0",
                 Interest
)
RETURN
Results   

 I guess the problem then becomes how to derive the beginning balances based on a measure rather than a table.

I could create new column and do the same Switch logic, but becomes very ineffiecent...

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.