Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
Currently, I am working on displaying data with a bar chart and a slicer, I would like to have the bar highlighted when being selected instead of just showing the selected item, how can I have the effect like fig 1 instead of fig 2, thx!
Fig1:
Fig2:
Solved! Go to Solution.
Hey @gdxy ,
if the axis of the bar chart and the content of the slicer are coming from the same table this will not work.
Create a model that looks like this:
The table slicer is used to provide the content for the slicer.
Create a measure like this:
vizAid HighlightColumn =
var SelectedSlicerItems = VALUES( 'Slicer'[item] )
return
IF(
SELECTEDVALUE( 'Dimension'[item] ) in SelectedSlicerItems
, "red"
, "blue"
)
Use the measure to add conditional formatting to the columns:
Use the table Dimension to populate the axis, then you can create something like below:
Hopefully, this provides what you are looking for.
Regards,
Tom
Hey @gdxy ,
if the axis of the bar chart and the content of the slicer are coming from the same table this will not work.
Create a model that looks like this:
The table slicer is used to provide the content for the slicer.
Create a measure like this:
vizAid HighlightColumn =
var SelectedSlicerItems = VALUES( 'Slicer'[item] )
return
IF(
SELECTEDVALUE( 'Dimension'[item] ) in SelectedSlicerItems
, "red"
, "blue"
)
Use the measure to add conditional formatting to the columns:
Use the table Dimension to populate the axis, then you can create something like below:
Hopefully, this provides what you are looking for.
Regards,
Tom
In normal course of action it is not possible.
workaround , Create a slicer and table and chart
remove the interaction between chart and Slicer
create interaction between chart and table as highligh
select slicer which shows single value in table and select the value in table which creates the effect required by you!
But that I donot think that is going to be an automated !
Proud to be a Super User!
I can't imagine any way that would be possible... sorry
Hi @gdxy ,
1) You can remove the interaction of the slicer with the bar chart so that it doesn't filter out the selected element in bar graph.
2) Then create a measure for highlighting colour of the selected bar -
Measure = IF(Level = SelectedValue(Level), "Dark Colour hex code for highlighting","Light Colour hex code for highlighting")
3) Add this colour returning measure to the "Fx" option of the bar chart setting of Bar colours.
Hope this helps!
Please accept the solution if this answers your query.
Thanks,
Avantika
And what would the Level in IF(Level = ...) be in a measure? That's not possible.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
101 | |
84 | |
79 | |
69 |
User | Count |
---|---|
120 | |
110 | |
95 | |
82 | |
77 |