Autoscaling by memory

I cannot seem to get this working.

Could you please explain to me the proper way of balancing the hpa between cpu and memory inside of the deployment? I keep getting target unknown.

An example of a deployment/service/hpa would be beneficial. I can supply my template I currently have if necessary