Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hope somebody can help with this?
I have a slicer and a clustered bar chart.
The slicer shows a list of departments and the bar chart shows the results for each department of a survey question.
Is there any way of formatting the bar chart so that the color of a bar will change color if its corresponding value is selected in the slicer? So for example here, as Adult Services is selected, it's bar color wil change color to red:
but if Finace and audit were selected its color would change to red.
Solved! Go to Solution.
Using the same disconnected table but with the logic in the measure reversed
Disconnected Total Revenue =
CALCULATE (
[Total Revenue],
TREATAS ( VALUES ( 'Disconnected Category'[Category] ), Category[Category] )
)
Disconnected Conditional Bar Color =
IF (
SELECTEDVALUE ( 'Disconnected Category'[Category] )
IN VALUES ( Category[Category] )
&& ISFILTERED ( Category ),
"red"
)
Please see the attached pbix
Thanks for your responses, very helpful and I can get it working if I add in a separated table, however the existing slicer is currently used to filter other visuals on the page so I would need a solution that uses the existing slicer.
I can't upload my pbix file due to org data security.
Using the same disconnected table but with the logic in the measure reversed
Disconnected Total Revenue =
CALCULATE (
[Total Revenue],
TREATAS ( VALUES ( 'Disconnected Category'[Category] ), Category[Category] )
)
Disconnected Conditional Bar Color =
IF (
SELECTEDVALUE ( 'Disconnected Category'[Category] )
IN VALUES ( Category[Category] )
&& ISFILTERED ( Category ),
"red"
)
Please see the attached pbix
Thank you so, much. Seems to be working fine.
@danextian very good
I did not notice that the customer was ok with hiding the not selected items in the slicer in the below table.
Very good solution!
with your existig slicer it is impossible to obtain what you are asking as that will filter automatically the value you select
If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your thread
Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page
Consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
Ah, OK. Thanks for responding.
You are welcome, pls mark as a solution and kudos if you believe anybody deserves it
so others can easily find the answers and possible solutions
Thx
Have you even validated your response before posting it?
Why are you telling OP to create a field parameter table by adding all the deparment fields. It is clear in the screenshots that the departments are in a single column? And even if you meant measures by fields, why would you have OP to unnecessarily create one for each distinct department? And what's with those extra responses?
Hello @danextian,
The response you commented on has been removed for being inaccurate.
Best,
Natalie H.
Community Manager
Hi @Fusilier2
You’ll want to use a disconnected table for the categories. If you use the same table (or one that's related), selecting something like "Finance & Services" will filter the bar chart to just that one category. With a disconnected table, you avoid that and can still apply conditional formatting using a measure that refers to it.
Please see the attached sample pbix.
It is possible but you need to create a separated table to make this work
Can you share the pbix via some cloud service? Otherwise I give you a path to follow
If this helped, please consider giving kudos and mark as a solution
@mein replies or I'll lose your thread
Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page
Consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
Here is the path
1 create a new table
Selection = ALLNOBLANKROW ( Table[column] )
where Table[Column] is the column where you have the values "Finance and audit", etc
Leave the new table disconnected ftomr the model
2 create the following measure
If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your thread
Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page
Consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 39 | |
| 37 | |
| 29 | |
| 24 |
| User | Count |
|---|---|
| 124 | |
| 107 | |
| 80 | |
| 69 | |
| 67 |