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

How to change the color of slicer values

I have a column in my table called "Scores". scores has 4 unique values which are "M", "B", "S", "T"

after selecting the "Scores" column as a slicer, I want to display the display slicer values in the fllowing color format and in the following order. 

rohanazad94_0-1666299828318.png

Can I get any suggestion as to how can that be done?

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @rohanazad94 ,

According to your description, here's my solution.

1.Then text type column sorts in alphabetical order by default. If you want it so sort in a custom order, add a custom column in Power Query.

vkalyjmsft_0-1666333729464.png

Rank = if [Scores] = "M" then 1 else if [Scores] = "B" then 2 else if [Scores] = "S" then 3 else 4

Then in Desktop, select Scores column, then click Sort by column>Rank.

vkalyjmsft_1-1666333787758.png

Result:

vkalyjmsft_2-1666333849372.png

2.Conditional formatting is not allowed in slicer by default, you can only use it in other visuals, like table visual.

Color =
SWITCH (
    MAX ( 'Table'[Scores] ),
    "M", "Green",
    "B", "Yellow",
    "S", "Purple",
    "T", "Red"
)

Select the visual, then in visual formatting pane, under Cell elements, turn on the Backgroud color.

vkalyjmsft_3-1666334040733.png

Select the measure in the dialoge.

vkalyjmsft_5-1666334156634.png

Result:

vkalyjmsft_6-1666334203701.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

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-yanjiang-msft
Community Support
Community Support

Hi @rohanazad94 ,

According to your description, here's my solution.

1.Then text type column sorts in alphabetical order by default. If you want it so sort in a custom order, add a custom column in Power Query.

vkalyjmsft_0-1666333729464.png

Rank = if [Scores] = "M" then 1 else if [Scores] = "B" then 2 else if [Scores] = "S" then 3 else 4

Then in Desktop, select Scores column, then click Sort by column>Rank.

vkalyjmsft_1-1666333787758.png

Result:

vkalyjmsft_2-1666333849372.png

2.Conditional formatting is not allowed in slicer by default, you can only use it in other visuals, like table visual.

Color =
SWITCH (
    MAX ( 'Table'[Scores] ),
    "M", "Green",
    "B", "Yellow",
    "S", "Purple",
    "T", "Red"
)

Select the visual, then in visual formatting pane, under Cell elements, turn on the Backgroud color.

vkalyjmsft_3-1666334040733.png

Select the measure in the dialoge.

vkalyjmsft_5-1666334156634.png

Result:

vkalyjmsft_6-1666334203701.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

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

 

 

Thank you so much. The solution you provided worked.

TomMartens
Super User
Super User

Hey @rohanazad94 ,

 

I'm unaware of any custom visual that provides the capability you are looking for. The default Slicer visual does not support this capability.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
Join Arun Ulag at MPPC23

Join Arun Ulag at MPPC23

Get a sneak peek into this year's Power Platform Conference Keynote.

PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Top Solution Authors