Forum Discussion
Help - Highlight graph by Slice
Hi Guys,
I have a challenge that I need to highlight a single section when I select this value from the slice.
For example, the slice is used as date filter then I select January of 2019 and I would like to highlight January 2019 in my Graph.
is it possible?
Thank you!
Hi Anonymous,
You mean something like below:You may refer to this file which uses the same formulas I posted:
https://drive.google.com/file/d/1heSHSD71mag8pn7GgCWDisdtoMxkWUz8/view?usp=sharing
8 Replies
- danextianSuper User
Hi Anonymous ,
There are many approaches to this but basically, they make use of a disconnected slicer table (one that has no relationship to fact table) and measures to calculate for the selected items and those that aren't.
First create a calculated table. Something like
Disconnected Table = DISTINCT('Fact'[period])
Then create these measures:SelectedPeriod = CALCULATE ( SUM ( 'Fact'[value]), INTERSECT ( VALUES ( 'Fact'[period] ), VALUES ( 'Disconnected Table'[period]) ) )OtherPeriods = SUM ( 'Fact'[value] ) - [SelectedPeriod]Use these measures in your chart and change the data color as desired. You will need to use the column from the disconnected table for your slicer. You may also refer to this tutorial http://sqljason.com/2018/03/highlighting-scatter-charts-in-power-bi-using-dax.html There is a downloadable sample pbix on the bottom part of the page.
- AnonymousNot applicable
Thanks for your message,
I just checked in this power bi sample, when state (slice) is selected the graph also fiters but what I really need is just to highlight the state selected.
- danextianSuper User
Hi Anonymous,
Are we looking at the same sample? In the image below, I selected california which highlighted a point in the scattergraph next to it instead of filtering it. If you don't use a disconnected table, the expected behavior is the slicer or a visual will crossfilter all other visuals.
- AnonymousNot applicable
I have the same problem as mentioned here but only difference is instead of bar graph I have scatter chart. The slicer is date slicer. The suggested approach is not working for scatter chart. Can anyone share pbix file for same. It would be really helpful.
- danextianSuper User
Hi Anonymous ,
The original solution from sqljason uses a scattergraph: http://sqljason.com/2018/03/highlighting-scatter-charts-in-power-bi-using-dax.html