Is there any errors occurs in event log? Which version of Kentico you are using? I tried this code bellow and works fine in widget container template.
{% if (!string.IsNullOrEmpty(CustomFieldName)){ %}
<h1>Test: {% CustomFieldName %}</h1>
{% } else { %}
<h1>Some dummy text</h1>
{% } |(identity)GlobalAdministrator%}
You should not wrap [Web part] placeholder in your container with macro.