Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
nanacobsbs
Helper I
Helper I

Change color DAX or something

I have the following scatterplot and want to change the color of the markers for the groups selected by the slicer.
Is it possible to achieve this using the DAX formula or other functions?

1. When group A is selected, the corresponding items will be red, and items in groups B and C will be gray.
2. When group B is selected, the corresponding item will be yellow, and the items corresponding to groups A and C will be gray
3. When group C is selected, the corresponding item will be blue and the items corresponding to groups A and B will be gray.

nanacobsbs_0-1743063948473.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @nanacobsbs,

 

As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.

 

Regards,
Vinay Pabbu

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @nanacobsbs,

 

As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.

 

Regards,
Vinay Pabbu

FarhanJeelani
Super User
Super User

HI @nanacobsbs ,

Yes, you can achieve this using DAX in Power BI by creating a Measure for the color logic and applying it to the scatterplot’s conditional formatting.

 

Steps to Implement:
Create a Measure to determine the color dynamically based on the slicer selection.

Apply this Measure to the scatterplot's marker color conditional formatting.

DAX Measure for Dynamic Coloring

ColorMeasure =
VAR SelectedGroup = SELECTEDVALUE('GroupTable'[Group]) -- Gets the selected group from the slicer
VAR CurrentGroup = MAX('DataTable'[Group]) -- Retrieves the group for the current row in the visualization

RETURN
SWITCH(
TRUE(),
SelectedGroup = "A" && CurrentGroup = "A", "Red",
SelectedGroup = "A" && CurrentGroup <> "A", "Gray",
SelectedGroup = "B" && CurrentGroup = "B", "Yellow",
SelectedGroup = "B" && CurrentGroup <> "B", "Gray",
SelectedGroup = "C" && CurrentGroup = "C", "Blue",
SelectedGroup = "C" && CurrentGroup <> "C", "Gray",
"Gray" -- Default color (when nothing is selected)
)


How to Apply This in Power BI Scatterplot:
Select the Scatterplot Visualization

Go to the Format Pane → Shapes

Expand "Markers" → fx (Conditional Formatting for Marker Color)

Choose "Field Value"

Select the "ColorMeasure" DAX Measure

Click OK

 

Please mark this post as solution if it helps you. Appreciate Kudos.

Thank you for your reply.
I tried to create the measure above, but it doesn't  work as bellow.

nanacobsbs_0-1743124588767.png

I would like to have Group A checked with the slicer but still have Group B and C markers visible and their colors grayed out.
Is it possible to achieve such a thing?



Anonymous
Not applicable

Hi @nanacobsbs,

 

When you select Group A in the slicer, Power BI filters the visual to show only Group A, which is why B and C markers disappear — not just their colors.

 

To fix this, you need to disconnect the slicer from filtering the scatter plot, and instead only use the slicer for the color logic.

 

Regards,

Vinay Pabbu

Thank you for your help!! It worked!!

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.