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 of chart axis labels problem

Conditional formatting is not applying correctly to the axis labels.  In the attached sample I have 2 tables with 9 rows each and a formatting measure that just compares the selection from Table 1 to the active row from Table 2.

Formatting = 
VAR _SelectedCustomer = SELECTEDVALUE ( Table1[Customer] )
VAR _DisplayCustomer = SELECTEDVALUE ( Table2[Customer] )
RETURN 
SWITCH(
    TRUE(),
    _SelectedCustomer = _DisplayCustomer, "Red",
    "Green"
    )

You can see that the Customer in the table follows the conditional formatting but the Y-axis label in the chart does not.  I even have the formatting measure as a tool-tip on the chart and it is picking up the right value.

conditional_formatting_problem.jpgI have attached my sample file for you to look at.

 

 

Status: Investigating

Hi @jdbuchanan71 

 

By testing on sample file from you, we found that SelectValue(Table2[Customer]) in bar chart context is identified as blank for there isn't a specific value checked. So x axis values will be displayed in red when SelectValue(Table1[Customer]) is blank, and display in green when you select an item in Slicer. If you create a relationship between Table1 and Table2 by Customer column. It will work.

 

vcazhengmsft_0-1635820169939.png

 

vcazhengmsft_1-1635820193328.png

Best Regards,

Community Support Team _Caiyun

 

Comments
v-cazheng-msft
Community Support
Status changed to: Investigating

Hi @jdbuchanan71 

 

By testing on sample file from you, we found that SelectValue(Table2[Customer]) in bar chart context is identified as blank for there isn't a specific value checked. So x axis values will be displayed in red when SelectValue(Table1[Customer]) is blank, and display in green when you select an item in Slicer. If you create a relationship between Table1 and Table2 by Customer column. It will work.

 

vcazhengmsft_0-1635820169939.png

 

vcazhengmsft_1-1635820193328.png

Best Regards,

Community Support Team _Caiyun

 

jdbuchanan71
Super User

@v-cazheng-msft 

Also, if you look at the tooltip for the bar chart the formatting measure is finding the correct value so the SelectValue(Table2[Customer]) isn't blank.

Creating a relationship between the two is not an option because I want to display all the bars in the chart but make every name except the selected one match the background.  Basically, hide the name of every customer except the selected one.  

chart_with_tooltip.jpg

bricwood
Helper I

I am experiencing the same issue as @jdbuchanan71.

The table conditional format works as expected. The bar chart tooltip reflects the correct value but does not format the axis label font colour correctly.