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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
timmay
Advocate I
Advocate I

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.