Forum Discussion
Conditional formatting a percentage based on other column
- 2 years ago
I think if you could provide a sample of your data set would be helpful.
Especially since I can't see how you could have two columns with the same name in Power BI.
Later edit: Try to create two separate measures, 1 for Real% January and one for Real% February. Maybe it will work.
Hi,
Probably I'm not getting your idea, but in your formula you only returns Green color if the Real_% is bigger than "Std".
So 1.32% is lesse than 1.67% so returns red and the same for the next par of values.
Probably i'm missing something
My bad, I used the wrong symbol and just edited my post.
Either way, I think that what I'm saying on the formula is:
| Color = IF ( MAX ( 'Table'[REAL_%]) < MAX ('Table'[STD_%]), "Green", "Red") |
If the maximum value in the column 'Real_%' is less than the maximum value in the column 'Std_%', then the condition is true and it returns a Green color, otherwise, Red.
Something like this excel that I have here:
- FromZero2BIHero2 years agoFrequent Visitor
Why not use this instead:
Colour =SWITCH(TRUE(),MAX('Table'[REAL_%])<MAX('Table'[STD_%), "GREEN","RED")- kdanielv2 years agoNew Member
I tried with your formula and is giving me the same result. Not quite sure what's going on.
- FromZero2BIHero2 years agoFrequent Visitor
I think if you could provide a sample of your data set would be helpful.
Especially since I can't see how you could have two columns with the same name in Power BI.
Later edit: Try to create two separate measures, 1 for Real% January and one for Real% February. Maybe it will work.
- _AAndrade2 years ago
Resident Rockstar
Now your formula seems right, so if is not working we need take a look the data and data model to underdtand what is wrong.
If you could Share a pbix file I could take a look.
If it's not possible, try to debug your formula putting the formula on the matrix and see what is returning.
For example, create a measure only with MAX( table REAL%) and see what this formula returns on the matrix.
And after do it the same for the other MAX funcion.
This is what I would do.
I hope this can help you to solve your problem.
- kdanielv2 years agoNew Member
Seems like the MAXX colouring is based on the total, not the Std for each individual row.
Let me try to change my data to something generic so I can share a pbix file