If you have a volt meter you can easily tell if no one else answers quickly for you. With key on (engine not running) and headlight switch off touch one lead of volt meter to a good ground (any good clean close by metal, preferrably the frame or (-) battery post) then touch the other lead of the volt meter to each of the 3 wires (brown, blue, and yellow) until 1 of them gives you a reading of 12 volts. You can do the same with a test light, instead of a volt meter.
Edit: Looks like it is the brown wire. Read the thread "Light bar set ups", page 2.
Take this opertunities to buy yourself a new tool... everyone that dales with wiring should have a proximity hot tester ... all you have to do is touch it to the wire and if it has power it will beep ... no puncturing wires or shrink wrap ... great tool ...
Well speaking of the headlight switch on my X4, I was wondering if anyone knows of a replacement switch that is backlit so you can see it in the dark. I’m also looking for a replacement for the 4WD one too. I had happen to see one on a Facebook Feed but lost its location to get more information.