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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Guy in A Cube Video "How do you conditionally highlight a bar in a Power BI Report"

I realize I am probably in the wrong support area, and I apologize in advance.


I watched this video last week and it is a very interesting concept and one I would like to implement.

Unfortunately I cannot locate the complete DAX code for the measure “BarToHighlight”.

 

Does anyone know where I can locate he complete DAX code?

 

I appreciate everyone’s help in locating this code.

 

Thanks

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

How about this:

BarToHighlight =
VAR _selectedmonths = VALUES ( SELECTEDDATE[Month] )
VAR _monthtohighlight = SELECTEDVALUE ( 'CALENDAR'[Month] )
VAR _filtered = ISFILTERED ( SELECTEDDATE[Month] )
VAR _result = SWITCH ( TRUE, NOT ( _filtered ), "#0079EB", _monthtohighlight IN _selectedmonths && _filtered, "0079EB", "99C9F7" )
RETURN
_result

 

Was that the right code?

 

Let me know! 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

tackytechtom,

Not pushing, but have you had any luck in locaing the DAX code?   Do you have another suggestion where I could ask for this code?

 

Thanks for your help.

 

Pierce

 

Hi @Anonymous ,

 

How about this:

BarToHighlight =
VAR _selectedmonths = VALUES ( SELECTEDDATE[Month] )
VAR _monthtohighlight = SELECTEDVALUE ( 'CALENDAR'[Month] )
VAR _filtered = ISFILTERED ( SELECTEDDATE[Month] )
VAR _result = SWITCH ( TRUE, NOT ( _filtered ), "#0079EB", _monthtohighlight IN _selectedmonths && _filtered, "0079EB", "99C9F7" )
RETURN
_result

 

Was that the right code?

 

Let me know! 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

tackytechtom
Super User
Super User

Hi @Anonymous ,

 

I am not sure what you mean by "locate". Do you mean where Patrick saved the measure? It appears to be in the disconnected table:

tackytechtom_0-1665603852212.png

 

 

Or are you after the whole DAX code for the measure?

 

 

By the way, I liked that video! Did not know how to do that either. Also the syncing of the slicers at the end is a nice little trick to know as well 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Anonymous
Not applicable

Thanks for the quick reply and question clarifying what I am looking for.

 

I am looking for the entire code for the measure or the PBIX associated with this demo.

 

Yes, the concept of syncing slicers is very interesting and an idea I noted in my BI notebook.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.