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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Fern_21
Advocate III
Advocate III

How to dynamically change color on a scatter chart based on the selection of two filters

Hi all!

I've a scatter plot that shows the revisions of the 
items table. I've also two filters: one for the revisions of the facilities table (open) and one for the revisions of the items table (closed).

When I select the open ones, the corresponding points on the chart should be red, while when I select the closed ones, the corresponding points should be blue. How can I do this? 
Facility and items are not directly connected to each other but are both related to a fact table.

Thanks!

3 REPLIES 3
v-kpoloju-msft
Community Support
Community Support

Hi @Fern_21,
Thank you for reaching out to the Microsoft fabric community forum.

Has your issue been resolved? If the response provided by the community member @burakkaragoz, addressed your query, could you please confirm? It helps us ensure that the solutions provided are effective and beneficial for everyone.

Also, kindly refer to the below mentioned link for better understanding:
Apply Conditional Table Formatting in Power BI - Power BI | Microsoft Learn

Hope this helps clarify things and let me know what you find after giving these steps a try happy to help you investigate this further.

Thank you for using the Microsoft Community Forum.

 

Hi @Fern_21,

Just checking in to see if the issue has been resolved on your end. If the earlier suggestions helped, that’s great to hear! And if you’re still facing challenges, feel free to share more details happy to assist further.

Thank you.

burakkaragoz
Community Champion
Community Champion

Hi @Fern_21 ,

You need to create a dynamic color measure that checks which filter is active and returns the appropriate color.

Create this measure:

Scatter Point Color = 
VAR FacilityFilterActive = NOT(ISFILTERED('Facilities'[Revision])) || ISBLANK(SELECTEDVALUE('Facilities'[Revision]))
VAR ItemFilterActive = NOT(ISFILTERED('Items'[Revision])) || ISBLANK(SELECTEDVALUE('Items'[Revision]))
VAR FacilitySelection = SELECTEDVALUE('Facilities'[Revision])
VAR ItemSelection = SELECTEDVALUE('Items'[Revision])

RETURN
SWITCH(
    TRUE(),
    NOT(FacilityFilterActive) && FacilitySelection = "Open", "Red",
    NOT(ItemFilterActive) && ItemSelection = "Closed", "Blue",
    "Gray"  // Default color when no specific filter is applied
)

Alternative approach if the above doesn't work:

Dynamic Color = 
VAR HasFacilityFilter = HASONEVALUE('Facilities'[Revision])
VAR HasItemFilter = HASONEVALUE('Items'[Revision])
VAR FacilityValue = IF(HasFacilityFilter, VALUES('Facilities'[Revision]), BLANK())
VAR ItemValue = IF(HasItemFilter, VALUES('Items'[Revision]), BLANK())

RETURN
CASE(
    FacilityValue = "Open", "Red",
    ItemValue = "Closed", "Blue",
    "Gray"
)

How to apply it:

  1. Add this measure to your scatter plot
  2. Drag it to the "Legend" field (not Values)
  3. Go to Format → Data colors
  4. Set "Red" to red color, "Blue" to blue color, "Gray" to gray

If Legend approach doesn't work: Try putting the measure in a conditional formatting setup:

  1. Select your scatter plot points
  2. Format → Data colors → fx (conditional formatting)
  3. Use your color measure as the field value

The key is that the measure needs to detect which slicer is active and return the appropriate color based on the relationship through your fact table.


If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.

This response was assisted by AI for translation and formatting purposes.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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