Piotr has attended:
Power BI Modelling, Visualisation and Publishing course
Power BI Modelling, Visualisation and Publishing course
Power BI Modelling, Visualisation and Publishing course
CONDITION FORMATTING, ON BOTH AXIS
Hello,
I have a simple clustered column chart graph showing names of products with two columns (two different values "X" and "Y") on every product.
In each product values differ from each other, so you can imagine that (X and Y) are bigger or smaller.
What I would like to achieve is to mark up product names on x-axis with different font colour.
For example If X > Y , then the product font colour is Red.
And If X < Y, then the product font colour is Green.
I know, that there is a tool with conditional formatting, but it's not ideal.
Maybe DAX would be more helpful? But I couldn't find a proper solution on Google.
Please let me know if there is anything that it can be done.
Kind Regards,
Piotr Jedrzejczyk
RE: CONDITION FORMATTING, ON BOTH AXIS
Hi Piotr,
Thank you for your question to the forum.
To my knowledge there is no conditional formatting feature that applies different colours to the x axis. However, you can highlight the data labels in 2 different colours depending on whether X>Y or Y>X. This is a preview feature that has become permanent as of this month's Power BI updates.
What you need to do is:
1. Create a new column in DAX and write XY difference = [X] > [Y]
2. Select the column chart and go to Data Labels > Values. Click on the fx symbol
3. In the dialog box, select 'Rules' then in 'What field to base on' select the XY difference formula
4. In the 1st rule set it to be >=0 and <100 or any number that is higher than the maximum out of your values. Select a green colour
5. Create a 2nd rule and set it to be >-100 or any number that is lower than the minimum out of your values. Select a red colour and click OK to apply this effect
If you still want to apply conditional formatting to the x axis then what I suggest is that you submit this as an idea under the Help tab in Power BI desktop
I hope this has helped
Kind Regards
Martin Sutherland
(MOS applications trainer)
Will be marked as resolved in 5 days
Notice: This is an automated message. Due to inactivity, this forum post will be marked as 'resolved' if there are no further responses in the next 5 days.