web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
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.

Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,991 Moderator on at

    @Corissandageri 

    Please provide the code you used here.

  • R Bakker Profile Picture
    725 on at

    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
     )
    ) 

     

  • Verified answer
    timl Profile Picture
    37,246 Super User 2026 Season 1 on at

    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

    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.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 320 Most Valuable Professional

#2
11manish Profile Picture

11manish 210

#3
Valantis Profile Picture

Valantis 167

Last 30 days Overall leaderboard