Box Mapping on just X & Y Axis
This is easier/smarter to do with a procedural texture for the dirt, but I got it to work.

I used Texture Coordinates&gt;Normal&gt;Separate RGB and plugged the Blue into a color ramp to get all the upward faces.
I mixed that using Mix RGB&gt;Multiply with a Gradient Texture, rotated 90 degrees on the y axis.
Together, these make a top to bottom gradient mask that ignores only the very top upward faces.

Little more complicated that I wanted, but maybe useful for texture layering.