Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hi good day, can anyone help me to correct my measure on contional formatting. I need if the Ratio is below target then Red if above then green and Orange if same.
Solved! Go to Solution.
Hi @AllanBerces
You formula is invalid because of how logical conditions are written. Each condition must be fully specified but you took a shortcut isntead. [Mech_Ratio] && [Scaff_Ratio] && [El_Ratio] - will return either true or false and you compare that with the second part of the condition which will return either true or false as well. True/False > True/False just doesnt make sense in this context. Try:
Mismatch Color_rev =
SWITCH (
TRUE (),
[Mech_Ratio] > [Mech Target]
&& [Scaff_Ratio] > [Scaff Target]
&& [El_Ratio] > [EI Target], "RED",
[Mech_Ratio] < [Mech Target]
&& [Scaff_Ratio] < [Scaff Target]
&& [El_Ratio] < [EI Target], "GREEN",
"ORANGE"
)
Hi @AllanBerces ,
Thank you for bringing this up, and I appreciate @danextian , @ryan_mayu valuable input on the logic structure. I’ve tested the full scenario and can confirm that the measure works as intended.
FYI:
I used Field value formatting in Power BI, and the colors display correctly. If you notice gradients or blue tones, please check that the format style is set to Field value, not Gradient.
I’ve attached a .pbix file with sample data for your reference. Let me know if you want to adjust the logic or make it dynamic.
Regards,
Yugandhar.
Hi @AllanBerces ,
Thank you for bringing this up, and I appreciate @danextian , @ryan_mayu valuable input on the logic structure. I’ve tested the full scenario and can confirm that the measure works as intended.
FYI:
I used Field value formatting in Power BI, and the colors display correctly. If you notice gradients or blue tones, please check that the format style is set to Field value, not Gradient.
I’ve attached a .pbix file with sample data for your reference. Let me know if you want to adjust the logic or make it dynamic.
Regards,
Yugandhar.
Hi @AllanBerces
You formula is invalid because of how logical conditions are written. Each condition must be fully specified but you took a shortcut isntead. [Mech_Ratio] && [Scaff_Ratio] && [El_Ratio] - will return either true or false and you compare that with the second part of the condition which will return either true or false as well. True/False > True/False just doesnt make sense in this context. Try:
Mismatch Color_rev =
SWITCH (
TRUE (),
[Mech_Ratio] > [Mech Target]
&& [Scaff_Ratio] > [Scaff Target]
&& [El_Ratio] > [EI Target], "RED",
[Mech_Ratio] < [Mech Target]
&& [Scaff_Ratio] < [Scaff Target]
&& [El_Ratio] < [EI Target], "GREEN",
"ORANGE"
)
maybe you can try this. Not sure if I understand your logic clearly, if this does not work ,you can try to change && to || to have a try.
Mismatch Color_rev =
SWITCH(
TRUE(),
[Mech_Ratio] < [Mech Target] && [Scaff_Ratio] < [Scaff Target] |&&[El_Ratio] < [EI Target], "RED",
[Mech_Ratio] > [Mech Target] && [Scaff_Ratio] > [Scaff Target] && [El_Ratio] > [EI Target], "GREEN",
[Mech_Ratio] = [Mech Target] && [Scaff_Ratio] = [Scaff Target] && [El_Ratio] = [EI Target], "ORANGE",
"ORANGE"
)
Proud to be a Super User!