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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
PowerRon
Post Patron
Post Patron

Strange behaviour between slicer and visual

Hi,

 

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  

knip1.jpg

 

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

knip2.jpg

 

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?

regards
Ron

8 REPLIES 8
PowerRon
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.

@ChiragGarg2512 

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

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

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

Send image and measure formula.

PowerRon
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
ChiragGarg2512
Solution Sage
Solution Sage

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

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.