Dear Aisha,
Thanks for your updates.
Another way in SharePoint Online may be to use the calculated column. However, the auto-generated ID column can't be applied to the calculated column, you may still need to create an auto-generated column for ID such as NumberID with the auto-populated values by using Power Automate or Power Apps. If you don't want to use Power Automate, you can use Power Apps.
You can create a single-line text column NumberID, click on Integrate>Power Apps>Customize forms to access Power Apps and type Last(List00D).ID+1 in DataCardValue2, type SubmitForm(SharePointForm1);NewForm(SharePointForm1) on OnSelect in Button Submit, type ResetForm(SharePointForm1);NewForm(SharePointForm1) on OnSelect in Button Reset and finally publish the form to SharePoint Online.
Then you can use the calculated column such as CalculatedNumber to get the desired number with the formula ="no-P"&TEXT(NOW(),"yy")&"000"&NumberID.
Result:
I'm afraid that there may be no out-of-the-box way getting the custom number format in SharePoint Online.
Thanks for your effort and time.
Sincerely,
Cliff | Microsoft Community Moderator