cancel
Showing results for
Did you mean:

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Helper IV

## How do I Apply Random Colours to Bar Chart

Hi

How do I Apply Random Colours to Bar Chart?

Please sample data below - i want every Team Name to have a Different Colour?

1 ACCEPTED SOLUTION
Super User

Create a measure like this

``BarColor = "#" & MID("0123456789ABCDEF",RANDBETWEEN(1,16),1) & MID("0123456789ABCDEF",RANDBETWEEN(1,16),1) & MID("0123456789ABCDEF",RANDBETWEEN(1,16),1) & MID("0123456789ABCDEF",RANDBETWEEN(1,16),1) & MID("0123456789ABCDEF",RANDBETWEEN(1,16),1) & MID("0123456789ABCDEF",RANDBETWEEN(1,16),1) ``

This generates a color in Hex e.g. #75AD21

Select the bar chart and under Format -> Data Colors click the fx button to enter the Conditional Formatting

Set a rule like this

Regards

Phil

If I helped you, click on the Thumbs Up to give Kudos.

Proud to be a Super User!

2 REPLIES 2
Helper IV

thanks @PhilipTreacy 👍

Super User

Create a measure like this

``BarColor = "#" & MID("0123456789ABCDEF",RANDBETWEEN(1,16),1) & MID("0123456789ABCDEF",RANDBETWEEN(1,16),1) & MID("0123456789ABCDEF",RANDBETWEEN(1,16),1) & MID("0123456789ABCDEF",RANDBETWEEN(1,16),1) & MID("0123456789ABCDEF",RANDBETWEEN(1,16),1) & MID("0123456789ABCDEF",RANDBETWEEN(1,16),1) ``

This generates a color in Hex e.g. #75AD21

Select the bar chart and under Format -> Data Colors click the fx button to enter the Conditional Formatting

Set a rule like this

Regards

Phil

If I helped you, click on the Thumbs Up to give Kudos.

Proud to be a Super User!