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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.