Forum Discussion
Customise colour values on Line and Stacked Column Chart
Hi,
I am looking for either a DAX or a way to change the default colours that have been applied to my values in the below chart;
It has been sorted into 2 colours, using a column from feild which states whether the value( Site) is 'Complete' or 'Incomplete'. I know i can manually change each value under fomratting tab, but wondered if i can set up conditional formatting or DAX for this?
Appreciated,
Rick
4 Replies
- negi007
Community Champion
RickSmalls83 yes, you can change the color basis a condition. on your visual under the data colors, you can set a condition like below to change the color of the bar
below is the sample visual
thanks
- RickSmalls83Frequent Visitor
negi007 thanks, i can see your rule above is based on the value being 'less than or equal to' a number / %, however my graph needs to be coloured according to a column i have in the 'column series', which states whether the value is 'incomplete' or 'complete' - so a text value. Please see below pivot table to see Status column;
Also need to colour this column itself in a colour for 'incomplete' and a colour for 'complete' if i can do that aswell?
- negi007
Community Champion
RickSmalls83 ok i understand you wish to change the default color for status complete or incomple this you can do like below
you put the status in the legend field and then under data colors change the default color
- KNP
Super User
Hi RickSmalls83,
If I understand correctly, I think you're after something like this.
(Adapt to suit obviously)
Colour = VAR vSite = SELECTEDVALUE('Table'[status]) RETURN SWITCH(TRUE(), vSite = "incomplete", "rgba(255,10,10,1)", vSite = "complete", "rgba(20,100,100,1)", "" )Example PBIX attached also.
Hope this helps.