Forum Discussion
Help - Highlight graph by Slice
- 6 years ago
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
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.
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.
- danextian6 years ago
Super 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.
- Anonymous6 years agoNot applicable
- danextian6 years ago
Super User
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