Hi, i want to create an app that requires the user to input values in specifc fields and based on those power apps will have to perform a complicated calculation. Specifically i want to create an option pricer in which the user/ database will populate fields for the strike price, volatility, time to expiration and the output will be the value of the option.
This calculation requires the use of statistical formulas such as the Normal distribution, math formulas LOG etc. which dont seem to be supported by powerfx.
Is there a way to perform the above? In power BI i know how to do it since DAX supports the required functions but the issue is that i cant have input fields the same way they exist in power apps.
Custom Connector or API Integration:
Guide To Custom Connectors In Power App (reality-tech.com)
Unleashing the Power of Power Apps: Creating Custom Connectors for Advanced Integration - Collab365 - Power Platformer
Custom connectors overview | Microsoft Learn
Use Power Automate (Flow):
Power Automate Functions: Cheat Sheet & Best Practices (citizendevelopmentacademy.com)
Custom metrics overview - Power Automate | Microsoft Learn
Use expressions in conditions in Power Automate - Power Automate | Microsoft Learn
thanks, very helpful background information.
Are there any resources you can share for the recommended solutions 1 & 2?
Hi @powertree,
Creating an option pricer in Power Apps that performs complex calculations involving statistical formulas like the Normal distribution and logarithms can be challenging, especially since Power Apps primarily uses PowerFX, which doesn’t directly support these advanced mathematical functions.
Find few approaches you may consider:
Custom Connector or API Integration:
You could create a custom connector or integrate with an external API that performs the option pricing calculations. This way, you can leverage a backend service (e.g., written in Python, C#, or any other language) that supports the necessary mathematical functions.
The Power App would send the input values (strike price, volatility, time to expiration) to the backend service, which would then calculate the option value and return it to the app.
Use Power Automate (Flow):
You can create a Power Automate flow that triggers when the user submits the input values in Power Apps.
The flow can perform the complex calculations using built-in expressions, custom code (e.g., JavaScript), or even call an external service (e.g., Azure Functions).
Once the calculation is done, the flow can update a field in your database or return the result to the Power App.
Approximate Formulas in PowerFX:
While PowerFX doesn’t directly support advanced statistical functions, you can approximate some of them using available functions.
For example, you can use the Power function to calculate exponentials (similar to EXP), and you can use basic arithmetic operations to mimic logarithmic behavior.
Keep in mind that these approximations may not be as accurate as specialized libraries or languages.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional