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

Notifications

Announcements

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:
I have the same question (0)
  • 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'
    )

     

  • 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

     

  • timl Profile Picture
    36,558 Super User 2025 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 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 

  • 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'

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 421

#2
WarrenBelz Profile Picture

WarrenBelz 365 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 339 Super User 2025 Season 2

Last 30 days Overall leaderboard