You can format grid members depending on their level position in the cube structure.
Create level formatting
This can be done through the Anaplan XL right-click menu or by writing the relevant lines in the format sheet, as shown:

The result in the grid:

Syntax
You can specify formats for subtotals using the syntax LEVEL:SUBTOTAL.

Parent-child dimensions
This method doesn’t currently support parent-child dimensions because members’ unique names don't include the level name.