Forum Discussion
Fill button colour based on field value
jitpbi , if you want to color in matrix/table/ display it is possible. But if you want in slicer it is not.
You can create a measure like give below and use that in conditional formatting with "field" option.
color =
switch ( true(),
FIRSTNONBLANK(Table[commodity],"NA") ="commodity1" && sum(Table[Value]) >500,"lightgreen",
FIRSTNONBLANK(Table[commodity],"NA") ="commodity2" && sum(Table[Value]) >1000,"lightgreen",
/// Add more conditions
"red"
)
https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-numbers-in-the-column
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values
You can check the custom filter for slicer
https://appsource.microsoft.com/en-us/marketplace/apps?product=power-bi-visuals
- jitpbi6 years agoPost Patron
Hi,
Thank you for the solution.
I have used the below measure:
Colour = SWITCH(TRUE(),FIRSTNONBLANK('Button Colour'[Current Status],"NA")="Healthy","green",FIRSTNONBLANK('Button Colour'[Current Status],"NA")="Anomaly","orange",FIRSTNONBLANK('Button Colour'[Current Status],"NA")="Prolonged Anomaly","yellow")I am using button to show the colour but here i am not able to apply filter on equipment field. So, if i want to use a button for each different equipment then how to achieve it.Thanks,