Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

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!

1 ACCEPTED SOLUTION

Hi @Anonymous,


You mean something like below:

highlight selected2.png

You may refer to this file which uses the same formulas I posted:

https://drive.google.com/file/d/1heSHSD71mag8pn7GgCWDisdtoMxkWUz8/view?usp=sharing 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

8 REPLIES 8
danextian
Super User
Super 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. 

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Anonymous
Not 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.

Hi @Anonymous ,

The original solution from sqljason uses a scattergraph: http://sqljason.com/2018/03/highlighting-scatter-charts-in-power-bi-using-dax.html





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Anonymous
Not applicable

@danextian 

 

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.

 

 

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. 

highligh selected.png





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Anonymous
Not applicable

Hi @danextian 

 

I meant when you select california from the slicer pane on the left.

Hi @Anonymous,


You mean something like below:

highlight selected2.png

You may refer to this file which uses the same formulas I posted:

https://drive.google.com/file/d/1heSHSD71mag8pn7GgCWDisdtoMxkWUz8/view?usp=sharing 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Anonymous
Not applicable

Hi @danextian 

 

Thank you so much,

 

Your solution helped me a lot!

 

Cheers,

 

Fabricio

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.