Forum Discussion

jsteffe's avatar
jsteffe
Helper III
1 month ago
Solved

Color based on slicer selection but with different forms, Scatter chart

I created a separate table for my slicer and whe I click on my slicer, my selectdpoint appears in RED in my scatter chart : 

It works with this function I put on Markers -->  Color --> function (Fx)

color_selected_point = If(SELECTEDVALUE(Slicer_firms[FirmName])=max(data[FirmName]),"red","blue")
The problem is that I want to change the form of all points bases on the fiels "Type".
If I put this field in Legend, I loose the function option for the color.

How can I do ? Without creating 2 charts ? The attempted result is :
all points are blue with different forms depending on the type and only selected point is red

Here is my pbix File : Download file

Thanks for your help.



  • Unfortunately, what you're trying to achieve isn't currently supported by the native Power BI Scatter chart.

    When you use:

    • Legend β†’ Power BI assigns colors automatically by category and disables conditional formatting (fx) for marker colors.

    • Conditional formatting (fx) for marker color β†’ You can't simultaneously use the Legend to control marker shapes/colors.

    So these two features are mutually exclusive in the current visual.

    Possible workarounds

    Option 1 (Recommended): Use Style instead of Legend (if available)
    If you're using the newer scatter chart experience, check whether you can assign your Type field to Marker shape/Style instead of Legend. This allows:

    • Shape = Type

    • Color = Conditional formatting (your DAX measure)

    If your version of Power BI doesn't support this, you'll need one of the alternatives below.

    Option 2: Use a custom visual
    Some custom scatter visuals (e.g., Deneb or Charticulator) provide much greater control over marker color, shape, and size simultaneously. With these, you can:

    • Color points based on your selected firm.

    • Assign different marker shapes based on Type.

    • Keep everything in a single visual.

    Option 3: Use a single conditional formatting measure
    If you're willing to give up the automatic legend colors, you can keep your DAX measure:

    color_selected_point =
    IF (
        SELECTEDVALUE(Slicer_firms[FirmName]) = MAX(data[FirmName]),
        "#FF0000",
        "#1F77B4"
    )

    and use marker shapes (if supported by your visual version) to distinguish the different Type values.

    Why this happens

    The native Scatter chart currently allows either:

    • Legend to drive category formatting, or

    • Conditional formatting (fx) to drive marker colors,

    but not both at the same time.

    If your goal is blue points with different shapes by Type, and only the selected firm highlighted in red, a Deneb visual is probably the best solution, as it supports independent encoding of color, shape, size, and other attributes.

    For more information:

    πŸ’‘ Helpful? Give a Kudos πŸ‘ β€” keep the community growing.

    βœ… Solved your issue? Mark this as the Accepted Solution βœ”οΈ

    Best regards, Prince Singh | Data Science & Microsoft Fabric Enthusiast

  • Hi jsteffe 

     

    are you looking for an output similar to this ? 

    If this is the output you're expecting, follow the steps below:

    1. Install the Enhanced Scatter Plot visual.
    2. Select your existing Traditional Scatter Plot.
    3. Click the Enhanced Scatter Plot visual icon to switch to the new scatter plot.
    4. Drag and drop the Type column into the Shape field.
    5. Turn on the Fill Points toggle.

    I have attached a sample that I created for your reference.

6 Replies

  • Hi jsteffe , 

    Wanted to let you know that unfortunately, the requirement is not possible with the native Power BI Scatter chart due to a limitation in how formatting works.

     

    The Scatter chart supports two mutually exclusive behaviors

    No Legend: Conditional formatting (Fx) for marker colour is available but marker shape cannot vary by a field.

    Legend populated: Marker shapes/colors are automatically assigned per legend category. The Fx button for Marker Color disappears, so you cannot conditionally color the selected point.

    I believe this is you are experiencing. Hence, both requirements are not satisfied at same time. 

     

    I would suggest you to use custom visuals if your organisation permitted.

    Best option: Enhanced Scatter

    • Details --> FirstName
    • Shape --> Type(this alone drives marker shape)
    • Legend --> leave empty
    • Color --> keep your existing fx measure (custom colour)

    Thanks,
    If you found this solution helpful, please consider giving it a LikeπŸ‘ and marking it as Accepted Solutionβœ”. This helps improve visibility for others who may be encountering/facing same questions/issues.

    • jsteffe's avatar
      jsteffe
      Helper III

      Hi and thans a lot for your answer.

      Your solution works when I transform my ScatterChart in an Enhancedscatter Visual (it means that my color conditionnal function was already linked in my first visual). But in new visual I don't see the Fx.

      But I want to create a new EnhancedScatter (start from nothing), I don't see the Fx button in the color menu ...

      Thanks again for your help

  • Unfortunately, what you're trying to achieve isn't currently supported by the native Power BI Scatter chart.

    When you use:

    • Legend β†’ Power BI assigns colors automatically by category and disables conditional formatting (fx) for marker colors.

    • Conditional formatting (fx) for marker color β†’ You can't simultaneously use the Legend to control marker shapes/colors.

    So these two features are mutually exclusive in the current visual.

    Possible workarounds

    Option 1 (Recommended): Use Style instead of Legend (if available)
    If you're using the newer scatter chart experience, check whether you can assign your Type field to Marker shape/Style instead of Legend. This allows:

    • Shape = Type

    • Color = Conditional formatting (your DAX measure)

    If your version of Power BI doesn't support this, you'll need one of the alternatives below.

    Option 2: Use a custom visual
    Some custom scatter visuals (e.g., Deneb or Charticulator) provide much greater control over marker color, shape, and size simultaneously. With these, you can:

    • Color points based on your selected firm.

    • Assign different marker shapes based on Type.

    • Keep everything in a single visual.

    Option 3: Use a single conditional formatting measure
    If you're willing to give up the automatic legend colors, you can keep your DAX measure:

    color_selected_point =
    IF (
        SELECTEDVALUE(Slicer_firms[FirmName]) = MAX(data[FirmName]),
        "#FF0000",
        "#1F77B4"
    )

    and use marker shapes (if supported by your visual version) to distinguish the different Type values.

    Why this happens

    The native Scatter chart currently allows either:

    • Legend to drive category formatting, or

    • Conditional formatting (fx) to drive marker colors,

    but not both at the same time.

    If your goal is blue points with different shapes by Type, and only the selected firm highlighted in red, a Deneb visual is probably the best solution, as it supports independent encoding of color, shape, size, and other attributes.

    For more information:

    πŸ’‘ Helpful? Give a Kudos πŸ‘ β€” keep the community growing.

    βœ… Solved your issue? Mark this as the Accepted Solution βœ”οΈ

    Best regards, Prince Singh | Data Science & Microsoft Fabric Enthusiast

  • Hi jsteffe 

     

    are you looking for an output similar to this ? 

    If this is the output you're expecting, follow the steps below:

    1. Install the Enhanced Scatter Plot visual.
    2. Select your existing Traditional Scatter Plot.
    3. Click the Enhanced Scatter Plot visual icon to switch to the new scatter plot.
    4. Drag and drop the Type column into the Shape field.
    5. Turn on the Fill Points toggle.

    I have attached a sample that I created for your reference.

  • v-csrikanth's avatar
    v-csrikanth
    Community Support

    Hi jsteffe 
    We would like to inquire whether have you got the chance to check the solutions provided by kushanNa Prince0011 ajaybabuinturi in commiunity to resolve the issue. We hope the information provided helps to clear the query. Should you have any further queries, kindly feel free to contact the Microsoft Fabric community.

  • v-csrikanth's avatar
    v-csrikanth
    Community Support

    Hi jsteffe 

    We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. And, if you have any further query do let us know.


    Thank you.