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.
Sunil Pashikanti - Tech Blog: PowerApps