I think that's because you are missing some close bracket in your DAX coding. The brackets should display in pairs.
pls make sure you put the close bracket in the right place, otherwise it will automatically add those missing close brackets in the end.