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 Platform Community / Forums / Power Apps / Calculate total amount...
Power Apps
Answered

Calculate total amount using exchange rate

(0) ShareShare
ReportReport
Posted on by

Hi guys ,

I have a table with exchange rates based on each date"Used power automate to generate rates from free exchange rate API"

MarwaAlhajri_0-1718090451518.png

MarwaAlhajri_1-1718090671856.png

 

now I want to calculate the total amount based on the currency we select 

like qucantity*unit price/exchange rate 

I used the code 

With(
   {
      wRate:
      LookUp(
         'Currency Rate to USD',
         'Created Date' = DataCardValue3.SelectedDate
      )
   },
   Value(TextInput3_2.Text) *
   Switch(
      Dropdown2_1.Selected.Value,
      "USD",
      wRate.'Created Date',
      "AED",
      wRate.'Created Date',
      "OMR",
      wRate.'Created Date'
   )
)
Categories:
  • Gerard Simpson Profile Picture
    2,987 Moderator on at

    Hi - in your switch, you are referencing the 'Created Date' field - this should be 'Currency Rate to USD'

  • MarwaAlhajri Profile Picture
    on at

    Hi Thanks for the reply,

    I change it to the currency rate to USD but now I think the amount is showing wrong 

    MarwaAlhajri_0-1718093223120.png

    it's correct for OMR but if I change it to USD it is the same is it only taking one value which is OMR 

  • timl Profile Picture
    37,422 Super User 2026 Season 2 on at

    Hi @MarwaAlhajri 

    In the OnChange property of Dropdown2_1, you would need to call Reset on your Total Price text input control (eg, Reset(txtTotalPrice) ) if you want the value to update after changing the exchange rate.

  • MarwaAlhajri Profile Picture
    on at

    Hi, thanks for your reply,

    I did as you said, but still, the value didn't change 

    I changed the value of the dropdown box which contains currency USD, OMR AED ONChange value to 

    Reset(TextInput3_3)

    MarwaAlhajri_0-1718100397757.png

     

  • Gerard Simpson Profile Picture
    2,987 Moderator on at

    Hi - The initial LookUp is just grabbing the first row of the data and then this is passed through to the switch logic.

     

    Can you try this instead - this creates a filter table based on the date, which is then passed through and a lookup applied to grab the correct row of the filtered table...

     

    With(
       {
          wRate:
          Filter(
             'Currency Rate to USD',
             'Created Date' = DataCardValue3.SelectedDate
          )
       },
       Value(TextInput3_2.Text) * LookUp(wRate, Title = Dropdown2_1.Selected.Value).'Currency Rate to USD'
    )

     

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard