The data I use for my master dimension is a single column in a table called user_data, where I just want to categorize my 20 distinct values into 3 distinct values (by using the above mentioned formula). After doing so, I am counting all user (from that very same table) against the grouped dimension. So considering your answer, this should just work fine since I'm still in the same table.
I have the same issue. And it does not depend if both dimension and measure are calculated from the same table or not. I think the problem is with IF statement. When you create your master dimension with IF, coloring does nor work. Exactly the same dimension without IF statement works fine. So my work around is do define everything in load editor and then define master dimension without IF statement and set colors.
I hope this bug will be fixed soon, because it is extremely uncomfortable to define everything in load editor.