Value for Z-axis affect the Y-axis When I create a simple cube the objects blue Z-axis is ponting up, but when I'm still in object mode and want the change the dimension in the N menu, it's not working like when I create a new file.

I want to change the hight and enter a new value for the Z, but it affect the Y axis! I compared with a new file and there it was all OK, but not in my current scene. It worked well from start. I think I have activated some settings without knowing and I'm a bit lost and not nowing how to reset this setting or what it could be?
In Align to: View mode, the cube is created as the user has the view oriented:




Whereas in World mode, the cube is created aligned with the world axes (irrespective of the user's view):





Also, make sure your transform orientation is set to Global is you want to transform your object based on world axes: