- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dynamic Colors for Line Chart
We have a PBI report which shows the Year wise data on line chart . This data have assigned colors for each Year showing data. The issue we are facing ,whenever year changes on 01/01 of every year the line chart pops up data with new year and picks random color. This has required a manual intervention to go and assign the color as per pour company standards .
To avoid this manual change and keep it dynamic, need expertise to check whether there is any workaround/way in PBI where we can define the color codes on line charts for all upcoming years say next 50 years .
So that whenever new year data pops in, PBI Line chart picks the color we already defined for that year.
For ex:- on 01/01/2025 for Year 2025 new line will appear in chart with randomly picked color by PBI.
But we wanted to define it now before 12/31/2024 so that on 01/01/2025 it shows the color we defined already instead picking it randomly from pallet.
Suggestions are welcome
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,Arul ,thanks for your concern about this issue.
And I would like to share some additional solutions below.
Hello,@swapnilrlabhe .I am glad to help you.
For your needs, the general solution is to set the conditional format, and for each year of data, set the corresponding color for it separately (based on the value of MEASURE)
URL:
Apply conditional table formatting in Power BI - Power BI | Microsoft Learn
The problem is that this way is limited to some types of Visuals, for other Visuals where you can't set conditional formatting, if you want to set a specific display color for each year. As I understand it, the order of the color settings is based on the default order of the colors in the Theme you are currently setting up.
Like this:
Here is the issue and the official documentation.
URL:
Solved: How are theme colours assigned to series on a line... - Microsoft Fabric Community
Use report themes in Power BI Desktop - Power BI | Microsoft Learn
I've noticed that the color settings in the Theme seem to be limited to the first eight by default, here's my suggestion to you
You can contact your team members to define a Theme file (JSON file)
and set the color order of your implementation in it, and then use your own Theme, so that when power bi applies the member colors, they will be applied individually in the color order written in the file.
like this:
There are also some Theme File examples in the official documentation, hopefully they will help you.
{
"name": "Themetest",
"dataColors": ["#003B64", "#FFF200", "#FFD500", "#A9E0EA", "#231F20", "#49494A", "#737474", "#9A9B9B", "#C3C4C4", "#E7E7E7", "#FFFFFF"],
"background":"#FFFFFF",
"foreground": "#A9E0EA",
"tableAccent": "#FFD500"
}
Note that this is only an example, you will need to contact a member of your team who is proficient in front-end page design to collaborate on the Theme file.
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,Arul ,thanks for your concern about this issue.
And I would like to share some additional solutions below.
Hello,@swapnilrlabhe .I am glad to help you.
For your needs, the general solution is to set the conditional format, and for each year of data, set the corresponding color for it separately (based on the value of MEASURE)
URL:
Apply conditional table formatting in Power BI - Power BI | Microsoft Learn
The problem is that this way is limited to some types of Visuals, for other Visuals where you can't set conditional formatting, if you want to set a specific display color for each year. As I understand it, the order of the color settings is based on the default order of the colors in the Theme you are currently setting up.
Like this:
Here is the issue and the official documentation.
URL:
Solved: How are theme colours assigned to series on a line... - Microsoft Fabric Community
Use report themes in Power BI Desktop - Power BI | Microsoft Learn
I've noticed that the color settings in the Theme seem to be limited to the first eight by default, here's my suggestion to you
You can contact your team members to define a Theme file (JSON file)
and set the color order of your implementation in it, and then use your own Theme, so that when power bi applies the member colors, they will be applied individually in the color order written in the file.
like this:
There are also some Theme File examples in the official documentation, hopefully they will help you.
{
"name": "Themetest",
"dataColors": ["#003B64", "#FFF200", "#FFD500", "#A9E0EA", "#231F20", "#49494A", "#737474", "#9A9B9B", "#C3C4C4", "#E7E7E7", "#FFFFFF"],
"background":"#FFFFFF",
"foreground": "#A9E0EA",
"tableAccent": "#FFD500"
}
Note that this is only an example, you will need to contact a member of your team who is proficient in front-end page design to collaborate on the Theme file.
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you using year in Legend field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yes

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
09-05-2024 08:47 AM | |||
02-04-2025 06:08 AM | |||
10-10-2024 01:09 AM | |||
Anonymous
| 02-16-2025 11:43 AM | ||
12-07-2024 03:25 AM |
User | Count |
---|---|
114 | |
92 | |
84 | |
54 | |
46 |