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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Conditional formatting for date slicers conditionally broken

Hello,
I have a strange behaviour with two slicers which seems to be a bug in Power BI Desktop

 

First, I created a table for a light and a dark theme. In it, one row is for the light theme and the other row is for the dark theme. I have stored different colour values (hex codes) in the columns. I now select the theme using a slicer. I use measures to determine the colour value that is to be used for the slicer title, for example.

Simplified example:

  • If I choose the dark theme, I use #FFFFFF.
  • If I choose the light theme, use #000000.

For the colour value changes I use a simple measure: MAX([column name]). I use the measure as a field value in the conditional formatting for titles (and other elements). This works fine if I have a dropdown slicer. But if I change the slicer to "between", then suddenly it no longer works. On the slicer where I change the theme, it doesn't work at all.

 

Here are two screenshots. One of the light and one of the dark theme.
In the middle is the colour code in the corresponding colour and the selected theme. On the left side are the calender-slicers that work. The colours of the titles change. On the right are the slicers that do not work. The 'broken' slicers always seem to use the colour from the dark theme. I don't understand why this is.

C_R_0-1698745662692.png

C_R_1-1698745702740.png

 

Best regards,
C_R

Status: Investigating
Comments
Anonymous
Not applicable

Hi  @C_R ,

 

Are you using the latest version of Power BI Desktop?

Could you please provide a sample pbix or a detailed reproduction step? (Please be careful not to include sensitive information)

I tried to do a simple test but it doesn't seem to reproduce the problem, any more information would be great.

 

Best regards.
Community Support Team_ Caitlyn

C_R
Frequent Visitor

Hello Caitlyn,

yes I am using the latest version of Power BI Desktop.

C_R_1-1699256736590.png

I'd love to provide a pbix, but I cannot upload this file type here. Due to a lack of a sharing platform, I try to explain, what I have done as detailed as possible. I will simplify though.

1. Create the 'Calendar'-table

2. Create a slicer on the Calender's date column.

3. Create a 'Themes'-table (via data input):

ThemeBackgroundFont
Light#000000#FFFFFF
Dark#FFFFFF#000000

4. Create measures to identify

4.1 ...the selected theme: 'Selected Theme = MAX(Themes(Theme))'

4.2 ...the selected background color: 'Selected Background = MAX(Themes(Background))'

4.3 ...the selected font color: 'Selected Font = MAX(Themes(Font))'

5. Create a slicer on the 'Theme'-column so that I can switch the value between 'Light' and 'Dark'.

If the slicer is selecting 'Light' the measure 'Selected Background' should return '#000000' and the 'Selected Font' is '#FFFFFF'. Switching the slicer to 'Dark' results in 'Selected Background' = '#FFFFFF' and the 'Selected Font' = '#000000'.

6. Use conditional formatting to change the font-/backgroundcolors according to the selected theme.

6.1 On the slicer title I use conditional formatting that evaluates the field value 'Selected Font'-Measure.

6.2 On a simple rectangle form, which is the background, I use conditional formatting on the background color that evaluates the field value 'Selected Background'-Measure.

 

With all set up, I simply switch the theme on the theme-slicer and get the described behavior.

I hope my description was detailed enough. If something is unclear, I will try to give further information.

marvindo
Regular Visitor

04.2024 and I can't believe that the problem still there !!