Skip to main content
Community site session details

Community site session details

Session Id : MCfHPNLt7ig0MMIBkKtexv
Power Apps - Building Power Apps
Answered

calculation in datacard value

Like (1) ShareShare
ReportReport
Posted on 23 Feb 2023 11:27:09 by

Hi I'm using the following function in my power app form 

 

I've three column in my power app ( sharepoint list data source , column type Number )

The first column is autopopulated when user logs in "UNIT RATE "

the second column value is manullay entered by the user  " Quantity "

The third column is where I need to calculate the ( quantity * Unit rate) 

Update of amount column : Value(DataCardValue2.Text)

update of amount datacard : ThisItem.Amount

update of amount datacard value  =

Spoiler (Highlight to read)
If(
IsBlank(Value(ThisItem.'Quantity ')),
Blank(),
ThisItem.'Quantity ' * ThisItem.'Unit Rate '
)
If(IsBlank(Value(ThisItem.'Quantity ')),Blank(),ThisItem.'Quantity ' * ThisItem.'Unit Rate ')

Emptyglasses_3-1677151620971.png

 

 

Spoiler (Highlight to read)
Emptyglasses_2-1677151385775.png

 

 

the amount columnn is still showing as blank 

 

Could anyone please help to fix this issue

 

  • iAm_ManCat Profile Picture
    18,206 Most Valuable Professional on 23 Feb 2023 at 11:58:10
    Re: calculation in datacard value

    Yeah of course, happy to explain!

     

    Will put comments in it here:

    If(
     //Here we check the length of the text in the textinput
     // If it is zero then there's nothing in it
     Len(QuantityTextInput.Text)=0
    
     // The double pipe here '||' is another way to write 'Or'
     // I prefer this to 'Or' and I use '&&' when I need to do 'And'
     ||
    
     //Here we check the length of the text in the textinput
     // If it is zero then there's nothing in it
     //The reason we check the second item as well is that 
     // it will try multiply by a non-existent value if its empty
     Len(UnitRateTextInput.Text)=0,
    
     // In both of those cases we want it to then be blank
     Blank(),
    
     // if both of the above have values then we can safely multiply
     // however, their .Text property is a text, nto a number, so
     // we use Value() wrapped around it to convert the text to number
     // this then enables us to multiply the numeric values :)
     Value(QuantityTextInput.Text) * Value(UnitRateTextInput.Text)
    )

     

    Cheers,

    Sancho

  • Community Power Platform Member Profile Picture
    on 23 Feb 2023 at 11:49:50
    Re: calculation in datacard value

    Thanks man that worked perfectly fine 

    Could u please be details how did u end up with this formula 

     

  • Verified answer
    iAm_ManCat Profile Picture
    18,206 Most Valuable Professional on 23 Feb 2023 at 11:39:15
    Re: calculation in datacard value

    Hey @Anonymous 

     

    You are referring to ThisItem - but that refers to a value that already exists in a record (ie like the Original value before user changes), whereas you said that the user is entering it.

     

    I would instead refer to the TextInput controls themselves in this case:

    If(
     Len(QuantityTextInput.Text)=0
     ||
     Len(UnitRateTextInput.Text)=0,
     Blank(),
     Value(QuantityTextInput.Text) * Value(UnitRateTextInput.Text)
    )

     

    Cheers,

    Sancho

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June 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 > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 1

Loading started
Loading complete