The error is because hierarchy is not defined. So check clearly did you define hierarchy in your model. As a thumb rule, it is good to check hierarchy is defined or not for respective calculation whenever ITEM keyword is used.
Also you added " at the end of formula instead of '. The correct calculation is CODE(ITEM('P1 Product Family'))
sadly, no I still am getting the following error message; also I must not understand what you mean by hierarchy has to be clearly defined. In my general lists I do not see where my Model differs from the real model.
I have a problem with clicking general lists. When I click on any of the lists as you said nothing appears in the formula, I mean it cannot be clicked. I checked everything and could not find anything wrong. It will be great if you can help me to solve this. Thanks.