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.
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.
- danextian4 years agoSuper 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