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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Whibley92
Helper II
Helper II

Change colour within Clustered Column Chart based on Slicer

How do I change the colours dependent on slicer selection. I have 3 categories in my slicer - I would like each one to be a different colour when selected, ie Completed = green, Incomplete = red, Pending = Amber

Whibley92_0-1709288255404.png

 

14 REPLIES 14
Whibley92
Helper II
Helper II

I know why, sorry. The slicer doesnt break down the data in the chart when you click on it so I used a table. 

Whibley92_3-1709298949235.png So I have to use a slicer to get the colours but then it just does:

Whibley92_4-1709299013546.png

 

 

saud968
Responsive Resident
Responsive Resident

Have you tried this

Color Measure =
SWITCH(
SELECTEDVALUE('SlicerTable'[Category]),
"Completed", "#00FF00", --Green
"Incomplete", "#FF0000", -- Red
"Pending", "#FFA500" -- Amber
)

Apply to Chart:
Go to the "Format" tab of your chart.
Select "Data colors" -> "fx"
Select the newly created "Color Measure."

 

Best Regards
Saud Ansari
If this post helps, please Accept it as a Solution to help other members find it. I appreciate your Kudos!

 

Yes I did, it just keeps them blue. I'm very new to Power BI so its probably really easy to do. Any advice on where I may be going wrong? 

Color Measure =
SWITCH(
SELECTEDVALUE('Learning Item Status report'[Status Overall]),
"Completed", "#5DDA7E", --Green
"Incomplete", "#F43232", -- Red
"Pending", "#F08439" -- Amber
)
saud968
Responsive Resident
Responsive Resident

No problem, we all have been in your position. I will request you to create an Excel sheet with some data remove the sensitive info and share that file. As it is difficult to understand what is going wrong when you are trying. 

Thank you. This is very basic data. 

Learner NameStatusOverall Status
Name 1Active-In ProgressIncomplete
Name 2CompletedCompleted
Name 3Active-Not StartedIncomplete
Name 4CompletedCompleted
Name 5Active-In ProgressIncomplete
Name 6CompletedCompleted
Name 7CompletedCompleted
Name 8CompletedCompleted
Name 9PendingPending

 

I am not using a slicer though as it doesnt perform the same when we selected as a table. The table keeps the total, then breaks down depending on which Overall Status selected.

 

Whibley92_1-1709303532679.png

 

 

saud968
Responsive Resident
Responsive Resident

download this file https://drive.google.com/file/d/123vIFR6hhwKut44QnQ_JzoyO4mnEqaU7/view?usp=drivesdk

and review it is working as expected. 

Best Regards
Saud Ansari
If this post helps, please Accept it as a Solution to help other members find it. I appreciate your Kudos!

Whibley92
Helper II
Helper II

I'm not using the slicer

saud968
Responsive Resident
Responsive Resident

These statuses are columns or measures. Also, the fx option you have to review other options and also did you try the custom column Dax
Below is another measure you can try

Color Measure =
SWITCH(
SELECTEDVALUE('SlicerTable'[Category]),
"Completed", "#00FF00", --Green
"Incomplete", "#FF0000", -- Red
"Pending", "#FFA500" -- Amber
)

Apply to Chart:
Go to the "Format" tab of your chart.
Select "Data colors" -> "fx"
Select the newly created "Color Measure."

 

Best Regards
Saud Ansari
If this post helps, please Accept it as a Solution to help other members find it. I appreciate your Kudos!



saud968
Responsive Resident
Responsive Resident

You can go to the format pane, then go to columns click on fx, and then set rules accordingly. saud968_2-1709289731191.png

 

 

saud968_0-1709289688957.png

Further, you can also create a custom column
Color = SWITCH(
MyTable[Status],
"completed", "green",
"incomplete", "red",
"pending", "amber",
"unknown" // Default color for any other status
)

Best Regards

Saud Ansari

If this post helps, please Accept it as a Solution to help other members find it. I appreciate your Kudos!

Its just making them all Orange

Whibley92_0-1709291248541.png

 

Syndicate_Admin
Administrator
Administrator

Hello, is the classification of the segmentation the same as the legend of the chart? That is, each of the sections of the stacked bar is a category of the state? If so, simply by clicking on the graphic and clicking on 'Format your visual' in the 'Visualizations' section you will find the 'Columns' option and in 'Series' you can click on each of them and modify their color, which appears just below.

tharunkumarRTK
Super User
Super User

I want the different segments of each column broken down into different colours when selected on the slicer, not block. 

saud968
Responsive Resident
Responsive Resident

Can you share a sample data with google drive and any other link, it would be great...remove all sensitive data

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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