Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

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  

 

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?

regards
Ron

8 Replies

  • Anonymous , Try going to column in format visual and fix them to a particular color.

    • ChiragGarg2512's avatar
      ChiragGarg2512
      Icon for Solution Sage rankSolution Sage

      Anonymous , 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
  • Anonymous's avatar
    Anonymous
    Not applicable

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

    • ChiragGarg2512's avatar
      ChiragGarg2512
      Icon for Solution Sage rankSolution Sage

      Anonymous , 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.

      • Anonymous's avatar
        Anonymous
        Not applicable

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