This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hi All 🙂
I need to make a plot where I have 150 different cities as my legend. The issue is now that the color chart is not repeating itself and just chooses random colors. How can I make it such that I have 8 colors repeating themselves up to all 150. So in case I choose City number 2 and 102 they are both within the same selection of colors.Color chart
Graph
This is what I get when I choose 2 different cities and this is NOT what I want, since they are not within the chosen color chart.Thanks in advance
Solved! Go to Solution.
Hi @Anonymous ,
How about something like so?
Color =
SWITCH (
TRUE (),
MAX ( 'Table'[Category] ) IN { "A", "D", "G" }, "Red",
MAX ( 'Table'[Category] ) IN { "B", "E", "H" }, "Yellow",
MAX ( 'Table'[Category] ) IN { "C", "F" }, "Blue"
)
For more details, please check the attached .pbix file.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
How about something like so?
Color =
SWITCH (
TRUE (),
MAX ( 'Table'[Category] ) IN { "A", "D", "G" }, "Red",
MAX ( 'Table'[Category] ) IN { "B", "E", "H" }, "Yellow",
MAX ( 'Table'[Category] ) IN { "C", "F" }, "Blue"
)
For more details, please check the attached .pbix file.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
When you add a legend to your chart you can only select the colours manually so for this you would need to go city by city and select the colours.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsThank you for your answer 🙂
Is there any way I can avoid doing it manually?
What if I have 500 cities next time? That would very tedious...
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 31 | |
| 25 | |
| 21 | |
| 18 | |
| 17 |
| User | Count |
|---|---|
| 62 | |
| 34 | |
| 33 | |
| 25 | |
| 24 |