Forum Discussion

sasuser's avatar
sasuser
Regular Visitor
7 months ago
Solved

Change Font of Column Header if values are empty

In my data I have 2026 months as columns (jan as column 3), Feb Column 4, etc. Col 1 is KPIs, Col2 is KPI category. Created matrix: KPIs in Rows, Jan 2026 in Values, Feb 2026 in Values, so on. Brought each month of the year in Values. Now since there is no data in Feb, March, April YET in KPIs, I want to cnahe font of Feb, March (months that have not yet happened yet) to match with backgrounf fill of matrix so that months that have not happened yet blend in with the matrix background color. I have used below formulas but font of the column header does not chnage. can someone share a solution?

 

Header Color – MyTextCol = VAR NonBlankCount = CALCULATE( COUNTROWS( FILTER(VALUES('query1'[FEB_2026]), NOT ISBLANK('01272026 AUTOMATION SQL'[FEB_2026])) ) ) RETURN IF(NonBlankCount = 0, "#1C1C3C", "#FFFFFF"

 

 

  • Hi sasuser ,
    Power BI doesn't support conditional formatting for column header font color in a Matrix visual. However, you can use conditional formatting to blend future month values with the background. Create measures to identify future months and set font color accordingly, then apply conditional formatting to the Matrix as described.

    See the attached .pbix file for reference.

7 Replies

  • Hi sasuser ,

     

    As far as I'm aware, you can't change the column header text colour in a Matrix visual dynamically.

     

    You can see whether a visual item can be dynamically changed or not by whether it has an 'fx' button next to it in the side bar. For example, VISUAL Title Text, Text Colour, and Background Colour can all be changed dynamically in response to a given measure value or conditions:


    Matrix Column Header Text Colour, however, can not:

     

     

    Pete

  • sasuser's avatar
    sasuser
    Regular Visitor

    Thanks! I am not seeing fx option believing data is in text datatype could be the reason. Is any workaround possible to figure this out?

  • v-sshirivolu's avatar
    v-sshirivolu
    Community Support

    Hi sasuser
    Power BI’s built-in Matrix visual doesn’t currently allow conditional formatting of column header font color, which is why the original DAX approach couldn’t produce the expected result. To create the same visual effect for future months, the solution is to ensure those month columns remain visible by using a measure that returns 0 instead of BLANK, preventing Power BI from hiding them. Conditional formatting is then applied to the matrix values and their backgrounds using a date-based measure. This makes future months blend into the report background so they appear faded or inactive, while the column layout and alignment stay intact. This method works within Power BI’s existing feature set and achieves the desired visual outcome without relying on custom visuals or unsupported functionality.

    • sasuser's avatar
      sasuser
      Regular Visitor

      Thank you, idea of converting values to 0's instread of BLANKS might work. I will implement it next week when back to office. meanwhile, do you think you can share an example and steps to blend column header with the baxckground? I would greatly appreciate it.

      • v-sshirivolu's avatar
        v-sshirivolu
        Community Support

        Hi sasuser ,
        Power BI doesn't support conditional formatting for column header font color in a Matrix visual. However, you can use conditional formatting to blend future month values with the background. Create measures to identify future months and set font color accordingly, then apply conditional formatting to the Matrix as described.

        See the attached .pbix file for reference.

    • v-sshirivolu's avatar
      v-sshirivolu
      Community Support

      Hi sasuser ,

      I hope the information provided above assists you in resolving the issue. If you have any additional questions or concerns, please do not hesitate to contact us. We are here to support you and will be happy to help with any further assistance you may need.