Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Mabelle
New Member

Assign color automatically in line chart

Hi,

I have a line chart with about 250 lines. This is very messy but normally a filter is used to display at most 10 lines.

All lines have different colors. But I would like to assign always the same colors to the first 10 lines.

Is there a way to do so?

2 REPLIES 2
Brian_M
Responsive Resident
Responsive Resident

You might be able to calculate a TOPN rank measure (1 to 10) and put this in your Legend field instead of the current field you have in there. Then the number 1 to 10 should never change colour, but unfortunately you would the item name would be replaced by the number 1 to 10 on your legend. 

 

In that case, you could put a table or matrix (or slicer) nearby on the same report page that listed both the item rank and the item name. e.g.

 

1. Green Eggs

2. Ham

3. Cheese

4. Toast

..

10. Peanut Butter

Brian_M
Responsive Resident
Responsive Resident

Hi Mabelle,

 

I have asked for this type of functionality here, where by you could define a column or measure in your model that would output a colour reference.

 

You could for example define a table with ten colours, e.g. Color 1 (e.g. #FF0000 = red) to Color 10 (#0000FF = blue) and then match this list of ten colours to your list of top ten items.

 

If you think this might help you out, please vote for the idea here and leave a comment letting MS know what your application / situation might be.

 

https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/13757925-dynamically-specify-data...

 

Hope that helps

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.