Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

With example

(0) ShareShare
ReportReport
Posted on by 725

Hi all

Just tried the With example from Microsofts documentation page showing a simple payments calculator, but all I get is a blank label. Not getting any errors and the formula is referencing to my three sliders. Feel I'm missing the elephant in the room somehow.

  • R Bakker Profile Picture
    725 on at
    Re: With example

    Hi timl

    Thank you so much, must familiarise myself with both the Slider and the With function a lot more, as they both seem very useful.

  • Verified answer
    timl Profile Picture
    34,933 Super User 2025 Season 1 on at
    Re: With example

    Hi @Corissandageri 

    It took me a while to figure that out - there's actually a bug with that code sample!

    The Years assignment at the top should be YearsSlider.Value. The original code causes a divide by zero error.

    The following should hopefully work for you.

     

    With( { AnnualRate: RateSlider/8/100, // slider moves in 1/8th increments and convert to decimal
     Amount: AmountSlider*10000, // slider moves by 10,000 increment
     Years: YearsSlider.Value, // slider moves in single year increments, no adjustment required
     AnnualPayments: 12 }, // number of payments per year
     With( { r: AnnualRate/AnnualPayments, // interest rate
     P: Amount, // loan amount
     n: Years*AnnualPayments }, // number of payments
     r*P / (1 - (1+r)^-n) // standard interest calculation
     )
    ) 

     

  • R Bakker Profile Picture
    725 on at
    Re: With example

    So I literally did a copy and paste. from Here 

    With( { AnnualRate: RateSlider/8/100, // slider moves in 1/8th increments and convert to decimal
     Amount: AmountSlider*10000, // slider moves by 10,000 increment
     Years: YearsSlider, // slider moves in single year increments, no adjustment required
     AnnualPayments: 12 }, // number of payments per year
     With( { r: AnnualRate/AnnualPayments, // interest rate
     P: Amount, // loan amount
     n: Years*AnnualPayments }, // number of payments
     r*P / (1 - (1+r)^-n) // standard interest calculation
     )
    ) 

     

  • mdevaney Profile Picture
    29,987 Super User 2025 Season 1 on at
    Re: With example

    @Corissandageri 

    Please provide the code you used here.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,605 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,946 Most Valuable Professional

Leaderboard