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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Post Patron
Post Patron

Strange behaviour between slicer and visual



I have a slicer based on a field parameter containing measures.
And I have a line and stacked column chart. When selecting everything the colors in legend and visual match  



When only selecting one slicer option, the colours constantly mix. Beneath you see Real Customer is grey in the legend but range in the column



Selecting from slicer one by one and then selecting the correct color won't help. Afterwards it will again mix up 

What is happening here and how to fix?


Post Patron
Post Patron

Hi @ChiragGarg2512  I implemented your solution, but still there is a mismatch when I only choose one selection from the slicer

@PowerRon , Share image because that is what the measure is supposed to avoid. The measure makes it such that whenever let's say real customer was selected it is paired with grey color, which was it's color preslicer selection.


In this case field parameter order, 

0-> Recovered

1-> Reimbursed

2-> Real Customer


If possible share a Dropbox link to pbix file.


FP Color = SWITCH(SELECTEDVALUE(FP_Amounts[FP_Amounts Order]),0, "#000099", 1, "#FD6400" , 2, "#b3b3b3")
FP_Amounts = {
    ("Recovered", NAMEOF('Key Measures'[Amount Recovered]), 0),
    ("Reimbursed", NAMEOF('Key Measures'[Amount Reimbursed]), 1),
    ("Real Customer Damage", NAMEOF('Key Measures'[Amount Real Customer Damage]), 2)
In this image real should be grey, but Legend says blue

In this image it shows twice blue. recovered should be blue and Real grey
Real should be grey, Reimbursed Orange, Recovered Blue
It constantly changes

@ChiragGarg2512  pbix file is pointing to a shared dataset. I can't send you the dataset

Send image and measure formula.

Post Patron
Post Patron

I did @ChiragGarg2512  but doesn't help

@PowerRon , I checked and this happens in the case of field parameters. What can be done is create a measure for conditional formatting of line and stacked column chart.


Create a dax using switch:

Measure 4 = SWITCH(SELECTEDVALUE(f1[f1 Order]),0, "#118DFF", 1, "#11239E" , 2, "#")
f1 is the field parameter. f1 order gives 0,1,2 respectively for whatever field parameter it holds. Then apply a switch statement that changes on the basis of order value. you can either put the color name or the hex code of the color. 
Now select a field parameter and go to column field in format visual of line and stack column chart. There is an option fx for conditional formatting. Change to field and add the measure. This should fix your problem.
Thank You
Super User
Super User

@PowerRon , Try going to column in format visual and fix them to a particular color.

Helpful resources

July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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