I need to modify a calculated column in a SharePoint List but is not possible

Lina Escobar 0 Reputation points
2024-07-26T13:59:37.54+00:00

Good morning

I am using the modern experience in SharePoint. The list view has 162409 items (list view threshold is 5000). I want to update a calculated column but when I click on OK, the following error appear "Sorry, something went wrong. The attempted operation is prohibited because it exceeds the list view threshold"

How can I fix it? This is really urgent.

Regards,

LME

Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments

1 answer

Sort by: Most helpful
  1. Ling Zhou_MSFT 23,695 Reputation points Microsoft External Staff
    2024-07-29T02:09:28.8766667+00:00

    Hi @Lina Escobar,

    Thank you for posting in this community.

    When a list view displays more than 5,000 items, a list view threshold error is encountered.

    Maybe we can try using PowerShell to modify the formula of the calculated column.

    1.Download PnP PowerShell module.

    2.Run following PowerShell to modify the formula of the calculated column:

    #Parameters
    $SiteURL = "https://crescent.sharepoint.com/sites/PMO"
    $ListName ="Projects"
    $ColumnName="Productivity"
    $ColumnFormula = "=(([Planned Efforts]/5)/[Actual Efforts])*8"
        
    #Connect to PnP Online
    Connect-PnPOnline -Url $SiteURL -Interactive
        
    #Set the calculated column Formula
    Set-PnPField -List $ListName -Identity $ColumnName -Values @{Formula=$ColumnFormula}
    

    3.Run following PowerShell to modify the name of the calculated column:

    #Config Variables
    $SiteURL = "https://Crescent.sharepoint.com"
    $ListName = "Team Projects"
    $FieldName= "ProjectStatus" #old Name
     
    Try {
        #Connect to PnP Online
        Connect-PnPOnline -Url $SiteURL -Interactive
         
        #Set Field Title and Description
        Set-PnPField -List $ListName -Identity $FieldName -Values @{Title="new name"} -ErrorAction Stop
        Write-host -f Green "Title Updated for Field '$FieldName'"
    }catch {
        write-host "Error: $($_.Exception.Message)" -foregroundcolor Red
    }
    

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.