Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi Friends,
I'm having a issue
Which is how to add font color by using confitional formatting.
Since these columns are created by using measure instead of a legit column.
How should I add color for it?
Especially for previous year font color.
Kindly assist.
Solved! Go to Solution.
Hi @rainchong7401 ,
Please follow these steps:
(1) Create a new measure
COLOR =
VAR _YEAR = MAX('Table'[Date].[Year])
RETURN IF(_YEAR = Parameter[Parameter Value] , "GREEN" , IF(_YEAR = Parameter[Parameter Value] -1, "RED" ,"PINK"))
(2)Final output
If this is not what you need, please provide sample files or point it further
Best Regards,
Gallen Luo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @rainchong7401 ,
Please follow these steps:
(1) Create a new measure
COLOR =
VAR _YEAR = MAX('Table'[Date].[Year])
RETURN IF(_YEAR = Parameter[Parameter Value] , "GREEN" , IF(_YEAR = Parameter[Parameter Value] -1, "RED" ,"PINK"))
(2)Final output
If this is not what you need, please provide sample files or point it further
Best Regards,
Gallen Luo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Jialluo,
This is not what I want
Hi @rainchong7401 ,
You can set conditional formatting directly here to change the font color of the measure
Font color can also be controlled by additional measures
COLOR =
VAR _YEAR = MAX('Table'[Date].[Year])
RETURN IF(_YEAR = 2021 , "YELLOW" , "PINK")
Best Regards,
Gallen Luo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Gallen,
This is more like hard coded. What if today I select 2020 as current year. Previous year is 2019.
Which mean 2019 return me as hard coded color ?
I want it to be chaging color dynamically based on my selection. (Current year = Green, Previous Year = Red)
If I select 2018 as current year return green font. previous year 2017 return Red
If I select 2020 as current year return green font. previous year 2019 return Red
User | Count |
---|---|
84 | |
80 | |
70 | |
47 | |
43 |
User | Count |
---|---|
108 | |
54 | |
50 | |
40 | |
40 |