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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. 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
Super User
Super User

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

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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