<$p> does not work when converting to docx via markdown

Hi, whenever I try to refer to a specific page by using <$p> in the docx output I it doesn’t show the page number but only question marks. I compile my project to a markdown-file and then using pandoc convert it to docx. Can anyone help? That be great!