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 / Sharepoint list and ca...
Power Apps
Unanswered

Sharepoint list and calcutation code not working

(0) ShareShare
ReportReport
Posted on by 4

Hi,

 

I´m using a sharepoint list with the following structure, and I´m getting some issues with the code.

 

I´m filtering based on the Name, Location and Indication and I want the users to be able to select the month ant then insert the values for New, Decom and Identified. Also I´m doing a calculation, New - Decom= ,  and inserting that value in the specific cell based on all those filters applied before. 

 

I´ve been able to make it work but using the New, Decom and Identified as the initial selection and then having the users inserting the value for each month. But, to facilitate the work of the users, i want to have them selecting the month and then inserting the values for the 3 fields.

 

NameLocationCODEIndicationStatus2019202020212022Jan.Feb.Mar.Apr.MayJuneJulyAug.Sept.Oct.Nov.Dec.TotalIDItem TypePath
JohnTexas1OP1New101248678125467890981   
JohnTexas2OP1Decom12567889032112453358   
JohnTexas3OP1Identified201567898907653345128   
JohnTexas4OP1Total-27-21-2-1-112225-544-3623   
JohnTexas5OP2New                    
JohnTexas6OP2Decom                    
JohnTexas7OP2Identified                   
JohnTexas8OP2Total                    
JohnTexas9OP3New                    
JohnTexas10OP3Decom                    
JohnTexas11OP3Identified                   
JohnTexas12OP3Total                    
JohnTexas13OP4New                    
JohnTexas14OP4Decom                    
JohnTexas15OP4Identified                   
JohnTexas16OP4Total                    
MarkCalifornia17OP1New                    
MarkCalifornia18OP1Decom                    
MarkCalifornia19OP1Identified                   
MarkCalifornia20OP1Total                    
MarkCalifornia21OP2New                    
MarkCalifornia22OP2Decom                    
MarkCalifornia23OP2Identified                   
MarkCalifornia24OP2Total                    
MarkCalifornia25OP3New                    
MarkCalifornia26OP3Decom                    
MarkCalifornia27OP3Identified                   
MarkCalifornia28OP3Total                    
MarkCalifornia29OP4New                    
MarkCalifornia30OP4Decom                    
MarkCalifornia31OP4Identified                   
MarkCalifornia32OP4Total                    

UpdateContext({
selectedRecord: LookUp(
'DBHardware',
Name = Dropdown_Name.Selected.Result &&
Location = Dropdown_Location.Selected.Result &&
Indication = Dropdown_Indication.Selected.Result
)
});

Set(
selectedMonth,
Dropdown_Month.Selected.Value
);

Patch(
'DBHardware',
selectedRecord,
{
[selectedMonth]: If(
StatusDropdown.Selected.Value = "New",
Value(TextInput_New.Text),
If(
StatusDropdown.Selected.Value = "Decom",
Value(TextInput_Decom.Text),
If(
StatusDropdown.Selected.Value = "Identified",
Value(TextInput_Identified.Text),
[selectedMonth]
)
)
),
'Total': If(
StatusDropdown.Selected.Value = "New" || StatusDropdown.Selected.Value = "Decom",
Sum('DBHardware'[selectedMonth]) + Value(TextInput_New.Text) - Value(TextInput_Decom.Text),
Sum('DBHardware'[selectedMonth])
)
}
)

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @MigWare

    If you are using a SharePoint calculated type column, don't. 

  • MigWare Profile Picture
    4 on at

    I´m not. all the calculation are being done on the patch formula

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @MigWare 

    OK, just checking.

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 366 Most Valuable Professional

#2
11manish Profile Picture

11manish 184

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 99 Super User 2026 Season 1

Last 30 days Overall leaderboard