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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

Top Kudoed Authors