To enable the memory counters, you need to enable Virtual Machine Insights on your Virtual Machine(s).
https://learn.microsoft.com/en-us/azure/azure-monitor/vm/vminsights-overview
https://learn.microsoft.com/en-us/azure/azure-monitor/vm/vminsights-performance