Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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!
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.
User | Count |
---|---|
5 | |
5 | |
3 | |
2 | |
2 |
User | Count |
---|---|
10 | |
7 | |
5 | |
4 | |
4 |