Forum Discussion

Bron_Smith's avatar
Bron_Smith
Frequent Visitor
1 year ago
Solved

Dynamic line colours based on two slicers

I am using the latest version of Power BI (August 2025) and can't role back to previous versions - company policy

 

I have roughly 250 locations that I am displaying on a line chart (not all at the same time!). They are classed by region and area, and there are a maximum of 10 locations within an area, and up to 7 areas within a region. I am using slicers for the region and area to limit the number of locations displayed on the line chart.

 

When I use the Region and area slicers, I want to see the colours for the locations (labelled in a table 1-10 with the appropriate hex colour code) change the colours of the line on the graph to match the hex colour in the table I have created. I can't find any way to do this. I've tried using Switch and selected values, but this limits me and if more regions, areas or locations are created then I'll have to manually add that to the switch. I don't want more than 10 colours, so I've coded each location as 1-10 with 1 being "blue" and 2 being "green" etc...

 

Bars and Columns on the respective visuals are all very well, but I need this to be a line chart showing each of the locations in the appropriate colour, and trying to conditional format them doesn't work because I can't select the colour I have put into the table for this purpose. I have removed the legend, and this still doesn't do what I need it to do. 

 

Does anyone have any brilliant ideas that will make this work? 

2 Replies