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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

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