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
hb380
Frequent Visitor

Different colours on small multiple line charts?

 I have a 2x5 set of line charts as small multiples and need to have a different colour for each line: 

hb380_0-1686070399030.png

 

I've seen youtube videos where they do this via conditional formatting but I don't have this option - I don't have a section called "Data colors" at all, just under "Lines" I have the option to choose a colour manually which applies to every chart:

hb380_1-1686070522797.png

I do have the option to apply conditional formatting to my titles and values so it seems weird that I can't do this to my lines or bars.

Is there any work around for me to do make these lines different colours? Any help appreciated, I'm still very new. I'm using the May 2023 version of desktop.

1 ACCEPTED SOLUTION
mahenkj2
Solution Sage
Solution Sage

Hi @hb380 ,

 

Possibly a work around here. If you would like to use same field which is used in small multiples, in legend, it does not allow. So create a duplicate column of small multiple column and use that in legend. You get different color for each line, as below:


mahenkj2_0-1686117064680.png

 

You also get more control to tweak the legends as well.

 

Hope it helps.

View solution in original post

3 REPLIES 3
mahenkj2
Solution Sage
Solution Sage

Hi @hb380 ,

 

Possibly a work around here. If you would like to use same field which is used in small multiples, in legend, it does not allow. So create a duplicate column of small multiple column and use that in legend. You get different color for each line, as below:


mahenkj2_0-1686117064680.png

 

You also get more control to tweak the legends as well.

 

Hope it helps.

I used this, thank you! I didn't have the option to add a legend as I had multiple measures on the Y axis (for data labelling), taking them off sorted it.

amitchandak
Super User
Super User

@hb380 , Conditional formatting is not supported in line visual. Create a measure on the field of small multiple, and use that in conditional formatting using the field value option. For that first, convert it the bar, do conditional formatting, and then change to line 

 

Brand Color = Switch( true(),
max('Item'[brand]) = "Brand 1" , "red",
max('Item'[brand]) = "Brand 2" , "blue",
max('Item'[brand]) = "Brand 3" , "green",
max('Item'[brand]) = "Brand 4" , "gray",
max('Item'[brand]) = "Brand 5" , "yellow",
max('Item'[brand]) = "Brand 6" , "orange",
max('Item'[brand]) = "Brand 7" , "brown",
max('Item'[brand]) = "Brand 8" , "Cyan",
max('Item'[brand]) = "Brand 9" , "Tan",
max('Item'[brand]) = "Brand 10" , "Violet",
max('Item'[brand]) = "Brand 11" , "Gold",
"silver"
)

 

How to do conditional formatting by measure and apply it on pie?
https://www.youtube.com/watch?v=RqBb5eBf_I4&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L
https://community.powerbi.com/t5/Community-Blog/Power-BI-Conditional-formatting-the-Pie-Visual/ba-p/...
https://amitchandak.medium.com/power-bi-where-is-the-conditional-formatting-option-in-new-format-pan...

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.