Forum Discussion
Milozebre
6 years agoHelper V
Colors based on parameters
Hello Community, I hope you are doing well, you and your families. I have a question, I found the beginnings of answers on this forum but I can't seem to do what I would like. Here is the backgr...
- 6 years ago
Hello
I dont find solution with a measure.
Anytime I put a legend to see year, its not working anymore.
With the measure and if I put the paramter table as legend and not the Year, its working.
Thank you for your help, youre awesome
amitchandak
6 years agoSuper User
Check color by rule and color by value
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting
Few examples of measure that can used in color by values after selecting fields
Color Date = if(FIRSTNONBLANK('Date'[date],TODAY()) <today(),"lightgreen","red")
Color sales = if(AVERAGE(Sales[Sales Amount])<170,"green","red")
Color Year = if(FIRSTNONBLANK('Date'[Year],2014) <=2016,"lightgreen",if(FIRSTNONBLANK('Date'[Year],2014)>2018,"red","yellow"))
- Milozebre6 years agoHelper V
Hello amitchandak
Thank you for the reply
I create a measure like this :
Mesure Jourcouleur =SWITCH(SELECTEDVALUE(Comptage[jour]);"JOB";"#009AA6";"Samedi";"#A1006B";"Dimanche";"#659200")Its workingBut When i choose 2 years, But when I choose 2 years, it works for both. Now I would like that for the previous year, the color be gray and for the current year, the colors that are in the measureThank you- amitchandak6 years agoSuper User
Combine with max year and create one or more combinations
If(max(Table[year]) =2007, SWITCH( SELECTEDVALUE(Comptage[jour]); "JOB";"#009AA6"; "Samedi";"#A1006B"; "Dimanche";"#659200"), ///change the color for another year SWITCH( SELECTEDVALUE(Comptage[jour]); "JOB";"#009AA6"; "Samedi";"#A1006B"; "Dimanche";"#659200") )- Milozebre6 years agoHelper V