Forum Discussion

MichaelaMul's avatar
MichaelaMul
Helper III
1 year ago
Solved

Conditionally Format X-Axis

Hi,   I would like to change the color of the Rakuten to red on the X-Axis- is there a way to do this? I added the following rule but it doesn't seem to work.  Thank you!  
  • OwenAuger's avatar
    1 year ago

    Hi MichaelaMul 

    Unfortunately the conditional formatting for the X-axis is computed once for the entire axis, not for each individual label on the X-axis. The axis labels must all be formatted the same colour.

     

    If you examine the DAX query generated by the visual using Performance Analyzer, you will see a portion of the query similar to below that returns the minimum (i.e. "first") Brand in order to determine the axis text colour:

     

    EVALUATE
        ROW(
            "MinBrand", CALCULATE ( MIN ( YourTable[Brand] ) )
        )

     

    This is evaluated at the visual level, and the formatting condition would only be true when only the single Brand "Rakuten" is visible in the overall context of the visual.

     

    There could be custom visuals out there that can do this, and I imagine it's possible to do this with Deneb if you want to explore that.

     

    Regards