Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I have a slicer of dates where a user can choose 1 or more dates (multiple selection). The expected scenario is for the user to choose 2 dates, where the intention is to show values on a clustered column chart comparing values as at the 2 selected dates for each of a number of scenarios. I have configured the chart such that the chart legend shows the 2 selected dates, and the bar colours are chosen (eg date 1 bar colour is grey and date 2 bar colour is blue for all scenarios).
All good and well. The problem comes when the date selection is changed by the user. I need my bars to all stay the same colour as originally chosen ie whichever 2 dates the user selects, the earlier date bars must always be grey, and the later date bars must always be blue. In many searches and trials so far, I have not been able to achieve this - the bars always change colour as the dates are changed to different dates because the bar colour is associated with the date and not with the position of the bar in the chart. I would like to know if anyone has either achieved this before or has some ideas on how to achieve this.
Solved! Go to Solution.
Drag [Date] to Axis instead of Legend and try Color formatting by field value from the Data colors card in the formatting pane.
Measure = IF ( SELECTEDVALUE ( 'Table'[Date] ) = CALCULATE ( MIN ( 'Table'[Date] ), ALLSELECTED ( 'Table'[Date] ) ), "#808080", "#0000FF" )
Drag [Date] to Axis instead of Legend and try Color formatting by field value from the Data colors card in the formatting pane.
Measure = IF ( SELECTEDVALUE ( 'Table'[Date] ) = CALCULATE ( MIN ( 'Table'[Date] ), ALLSELECTED ( 'Table'[Date] ) ), "#808080", "#0000FF" )
Thank you very much for your suggestion. This achieves what I need in terms of the colour consistency. Unfortunately moving the date to the Axis instead of the Legend means that the bars no longer group together neatly as before, and also the axis labels become crowded...
There isn't an option to apply the conditional colour formatting when the date is in the legend, so I may not be able to get any closer to the target view for now. But this is definitely a step in the right direction. My thanks, once again.