cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
timmay
Frequent Visitor

Format colour by field value - stacked column chart

Demo file is here:

https://www.dropbox.com/s/k2srqe2d7fxcp1e/Mock%20Data%20PBI.pbix?dl=0

Table 1 has colours based on field values

1.JPG

but with table 2, i can't use a formula or any field to select the colour

Capture.JPG

With table 2 I can only go and select each colour manually. This is annoying because as you can see on the right there are lots of product categories but if I want the charts to display good looking colours I have to manually select hundreds of different colours for products, which is something I won't be doing 🙂

 

Is there a different way of doing this? I don't want to have to select each colour manually.

As you can see, my table contains all of the colour hashes I need for the charts (last column)

 

table.JPG

But, like you can see in table 2 I want to show sales over time.

Is there any way to show table 2 with the colour selection coming from the colour hashes?

Thanks,

Tim

 

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support


Hi @timmay ,


The reason for the problem you described is: because the SKU field is placed in the legend in the stacked column chart visual of table2, and the colors corresponding to different skus default from the colour hash field of the original data source, and each histogram is finally formed. Composed of many different colors. The prerequisite for color selection based on conditions in table1 is that there are no fields in legend, and each histogram consists of only one color. This is the reason why tabel2 cannot perform the same operation as table1.

 

If the legend field in table2 is removed, you can also has colours based on field values as below:

Capture.PNG


If the problem is still not resolved, please provide detailed error information. Let me know immediately, looking forward to your reply.


Best Regards,
Henry


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

View solution in original post

3 REPLIES 3
v-henryk-mstf
Community Support
Community Support


Hi @timmay ,


The reason for the problem you described is: because the SKU field is placed in the legend in the stacked column chart visual of table2, and the colors corresponding to different skus default from the colour hash field of the original data source, and each histogram is finally formed. Composed of many different colors. The prerequisite for color selection based on conditions in table1 is that there are no fields in legend, and each histogram consists of only one color. This is the reason why tabel2 cannot perform the same operation as table1.

 

If the legend field in table2 is removed, you can also has colours based on field values as below:

Capture.PNG


If the problem is still not resolved, please provide detailed error information. Let me know immediately, looking forward to your reply.


Best Regards,
Henry


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

Hi Henry,

 

But without the sku in the legend the colors don't change to show the different skus.  I need to show the difference in sales over time so the colors show that sku's sales.

1.JPG

so even if i put the color hash into the data colors > default color > fx >format by field value > based on field > "first color hash" (pictured below).

2.JPG

The chart is shown as the "table 2" in the above image, without the different skus in different colours.

 

Thanks,

Tim

Hi @timmay ,

 

If you need to show the difference in sales over time so the colors show that sku's sales, after placing the sku field in the legend, you can only manually select hundreds of different colours for products.🙄This is the difference between these two tables.


Best Regards,
Henry


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

Helpful resources

Announcements
August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power BI Dev Camp Session 24 without aka link and time 768x460.jpg

Ted's Dev Camp - July 28, 2022

Watch Session 24 of Ted's Dev Camp along with past sessions!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors