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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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