Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Multiply a currency field with whole number

(0) ShareShare
ReportReport
Posted on by 65

I have a requirement of multiplying the price field which is a currency data type with the unit which is a whole number data type and store it in another field total amount which is a currency field. 

Tried to use the calculated field but it doesn't support the currency. Can someone help me write a JS to achieve this? 

Many thanks!

  • Leah Ju Profile Picture
    Microsoft Employee on at
    RE: Multiply a currency field with whole number

    Hi Partner,

    Have any updates?

    Please feel free to contacts me if you have any questions!

    Could you click 'Yes' under title to close the thread if my answer is helpful!

    Thanks in Advance!

  • Suggested answer
    Leah Ju Profile Picture
    Microsoft Employee on at
    RE: Multiply a currency field with whole number

    Hi Prajwal,

    Based on the Microsoft documentation, the calculation field supports currency type.

    https://learn.microsoft.com/en-us/power-apps/maker/data-platform/define-calculated-fields#column-types-that-support-calculations 

    pastedimage1677830551915v1.png

    And i can create the calculated field to get total amount:

    pastedimage1677831071754v2.png

    Test:

    pastedimage1677832261866v3.png

  • Suggested answer
    Pradeep Rai Profile Picture
    5,487 Super User 2025 Season 1 on at
    RE: Multiply a currency field with whole number

    function calculateamount(executioncontext)

    {
    var formContext=executioncontext.getFormContext();

    var amount = formContext.getAttribute(‘logical name’).getValue();

    var unitvalue=formContext.getAttribute(‘logical name’).getValue();

    var total=amount*unitvalue;

    formContext.getAttribute(‘logical name’).setvalue(total);

    }

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 181 Super User 2025 Season 1

#2
Siv Sagar Profile Picture

Siv Sagar 149 Super User 2025 Season 1

#3
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 124 Super User 2025 Season 1

Product updates

Dynamics 365 release plans