Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi, i'm looking for a way to apply color formatting to a field based on another field. my idea is to apply a specific color to the field Codigo_de_Ruta[Hacia] based on the action performed on the field Codigo_de_Ruta[De], the idea is that if the [DE] (Posicion actual) field is selected the [HACIA] (1. Posible Siguiente Paso) field must be highlighted. (images below):
thank you for your answer
Hi @JoseDavidM
Sorry I don't understand your expected result clearly. You want to highlight a slicer according to the selected value of the other slicer? Or something else? These two fields are from the same table, if you select a value in the left slicer, the slicer on the right side will be filtered to contain values which are related to the selected value in the left slicer. Do you mean you want to highlight these filtered values?
You can change the background color of the slicer conditionally with a measure like:
Color = SWITCH(SELECTEDVALUE('Codigo_de_Ruta'[De]),"Value A","Yellow","Value B","Green")
Kindly let me know if this helps.
Community Support Team _ Jing Zhang
If this post helps, please consider Accept it as the solution to help other members find it.
@JoseDavidM , You can create a color measure and use that in conditional formatting by using "Field value" option
refer for steps
https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values
Color Date =
var _min =minx(allselected(Date,Date[Year])
return
Switch( true(),
FIRSTNONBLANK('Date'[Year],year(TODAY()))-_min =0 ,"lightgreen",
FIRSTNONBLANK('Date'[Year],year(TODAY()))-_min =0 ,"blue",
"red")
if(FIRSTNONBLANK('Table'[Value],"true")= "true","green","red")
if(FIRSTNONBLANK(date[date],blank())= today(),"green","red")
if(max(date[date])= tofay(),"green","red")
sorry @amitchandak i was not able to adapt that code to my need, the fields [De] and [Hacia] in the table 'Codigo_de_Ruta' is a text field. i was looking to a way to get the current selected value in this object
that contain the values of the field [De] in order to create the conditional format based on that
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.