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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
FloridaMan55051
Advocate I
Advocate I

color of bars change when publishing to power bi service from power bi desktop

This bug has been around for a while. I'm thinking about just building the charts in deneb because I can hard code the colors and not worry about BS like this. Does anyone else have any solutions? Is there a way to hard code bar charts in DAX?

Power BI Desktop:

FloridaMan55051_4-1737299624967.png

Power BI Service after Publish:

FloridaMan55051_2-1737299606510.png

1 ACCEPTED SOLUTION
collinq
Super User
Super User

Hi @FloridaMan55051 ,

 

Depending on which type of visual you are using, the location of where to change the color might be in different locations.  But, if you go to the format for the columns in the visual, go to color and select the function option.

collinq_0-1737320876844.png

 

Then, you can use the formatting option to choose the color based on the column value:

collinq_1-1737320933828.png

 

 

 




Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!
Private message me for consulting or training needs.




View solution in original post

5 REPLIES 5
v-kpoloju-msft
Community Support
Community Support

Hi @FloridaMan55051,

 

Thank you for reaching out to the Microsoft Fabric Community Forum.

 

We really apologies for the inconvenience, after reviewing the issue of color of bars change when publishing to power bi service from power bi desktop, here are few steps to may resolve the issue.

 

  • Recommend verifying whether a custom theme is applied in Power BI Desktop. If a theme is set, ensure the same theme is applied in the Power BI Service. Navigate to the Home tab, switch the theme in Power BI Desktop, and confirm the theme being used. Publish the report and check if the issue persists.
  • To explicitly define the colors for each data point within the visual, select the bar chart in Power BI Desktop. Navigate to the Format pane and choose Data colors. Use the dropdown options for each field to manually assign specific colors to each data point. Once complete, republish the report.
  • For dynamically hardcoding colors using a field value, create a calculated column in DAX that assigns a color value, such as #RRGGBB. Use this column in the Data colors section for conditional formatting.

Dax Query:

 

BarColor = SWITCH(

    TRUE(),

    [Category] = "Category1", "#FF5733",

    [Category] = "Category2", "#33FF57",

    "#3333FF"  // Default color

)

 

  • It is advisable to test the report in the Power BI Service after implementing the changes to ensure consistent color accuracy.

If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.


Thank you.

Hi @FloridaMan55051,

 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

 

Thank you.

Hi @FloridaMan55051,


I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.


Thank you.

Hi @FloridaMan55051,

 

I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please accept it as a solution and give it a 'Kudos' so others can find it easily.

 

Thankyou.

collinq
Super User
Super User

Hi @FloridaMan55051 ,

 

Depending on which type of visual you are using, the location of where to change the color might be in different locations.  But, if you go to the format for the columns in the visual, go to color and select the function option.

collinq_0-1737320876844.png

 

Then, you can use the formatting option to choose the color based on the column value:

collinq_1-1737320933828.png

 

 

 




Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!
Private message me for consulting or training needs.




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.