Probably your "adaptive" or "automatic" screen brightness setting.  Go to your Start Screen and type "brightness", go down to "Settings", and click on Change Screen Brightness ... you should have an option to disable adaptive brightness and set the brightness to your liking.
My screen dims and gets bright constantly. No rhyme or reason. It's plugged in all the time, the display setting is set to bright. Both my wife and I have one of these and they both do the same thing and it's driving us bonkers almost to the point of returning them....any ideas???? Help
XPS18 New Computer