Forum Discussion
A simple conditional formatting rule
Hello,
I would like a conditional formatting rule, like:
- Red if the value of the measure is negative
- Green otherwise
Please illuminate me:
Thank YOU!
6 Replies
- bhanu_gautamSuper User
webportal , Can you provide details of column and conditions
- webportalImpactful Individual
Yes, it's just a annuall sales variation.
DIVIDE([ThisYear], [PrevYear])-1
- speedrampsSuper User
Try this
Please click the thumbs up and accept solution buttons.
Try learn basic Power BI with these free links efore asking more simple questions. Thanks.
https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-conditional-table-formattinghttps://www.youtube.com/watch?v=IgYiWRPqIZU
- webportalImpactful Individual
Hello,
Here it is:
- AnonymousNot applicable
Hi webportal ,
Please try creating a new measure:
Color = VAR __diff = DIVIDE([ThisYear], [PrevYear])-1 VAR __result = IF(__diff < 0, "Red", "Green") RETURN __resultAnd apply it to the field value:
Best Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
- webportalImpactful Individual
Hello Anonymous
Ok, but then for each measure I want a conditional formatting, I'll need another measure.
There should be a better way.