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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
AG_x11x
Frequent Visitor

specific variables assigned hex colour codes across any visualisation

Hi Friends

 

I was wondering if you have a good solution to setting certain data points/variables of a field in a table to be assigned a hex code so that when it is used in any visual that it is by default assigned this hex code? I know that we can pick / customise a hex code colour when it is in a visual however considering the volume of dashboards we need to create in a limited time this would be very time consuming. I know that we can create a default hex code per visual but I am after a solution where in any visual used this would be a default colour.

 

I used this solution but the limitation is that it doesn't work for line graphs:  https://www.youtube.com/watch?v=-FG0DSSAr60

Data:

E.g of specific variables assigned hex codes always

Class 1 = #FFFFFF

Class 2 = #FFA500

Class 3 = #FF0000

Class 4 = #00FF00

this is my code but it isn't translating into any of the line graph visuals... each value in a field here would be a name

colour hex #:
VAR selected value = SELECTEDVALUE(table[field]))
Return
SWITCH(selectedValue,
"A", "#FF0000"
"B", "#FFA500",
"#FFA500")

any suggestions on better process, script or perhaps SQL code is much appreciated

Many thanks in advance!

2 REPLIES 2
lbendlin
Super User
Super User

Thanks for your response 🙂 Essentially, using themes is too manual and slow because you would need to update each bar or line based on the data point. I was thinking about something faster like the script i provided above where certain data points in a field is hardcoded a hex code colour to speed up dashboard production. However, the caveat is that it doesn't populate for lines.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.