The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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
I know why, sorry. The slicer doesnt break down the data in the chart when you click on it so I used a table.
So I have to use a slicer to get the colours but then it just does:
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?
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 Name | Status | Overall Status |
Name 1 | Active-In Progress | Incomplete |
Name 2 | Completed | Completed |
Name 3 | Active-Not Started | Incomplete |
Name 4 | Completed | Completed |
Name 5 | Active-In Progress | Incomplete |
Name 6 | Completed | Completed |
Name 7 | Completed | Completed |
Name 8 | Completed | Completed |
Name 9 | Pending | Pending |
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.
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!
I'm not using the slicer
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!
You can go to the format pane, then go to columns click on fx, and then set rules accordingly.
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
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.
You can create a dax measure and use it for conditional formating
https://community.fabric.microsoft.com/t5/Desktop/Conditionally-format-bar-chart-column-colour-based...
I want the different segments of each column broken down into different colours when selected on the slicer, not block.
Can you share a sample data with google drive and any other link, it would be great...remove all sensitive data
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
111 | |
80 | |
78 | |
43 | |
37 |
User | Count |
---|---|
158 | |
111 | |
64 | |
59 | |
54 |