• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Cross Highlight Excel Charts

You are here: Home / Excel Charts / Cross Highlight Excel Charts
February 6, 2020 by Mynda Treacy

One of the cool features in Power BI is the ability to cross highlight from one chart to another by clicking on a column in one chart and instantly highlight the selected item in another, as shown below:

pbi cross highlight

We can also cross highlight Excel charts in almost the same way and without the need for VBA, as you can see below:

cross highlight demo

This technique requires a version of Excel that has Power Pivot, which is all Office 365, Excel 2019 and select earlier versions. Click here to see if your version of Excel has Power Pivot.

What if you don’t have Power Pivot?

If you don’t have Power Pivot you can still create this effect using formulas linked to PivotTables and regular charts, it just requires a few more steps and some wrangling of Excel charts. You’ll find an example of this in the file downloadable from the link below.

Watch the Video

Subscribe YouTube


Download Workbook

Enter your email address below to download the sample workbook.

By submitting your email address you agree that we can email you our Excel newsletter.
Please enter a valid email address.

Download the Excel file for both the Power Pivot Chart and regular Excel Chart methods. Note: This is a .xlsx file please ensure your browser doesn't change the file extension on download.

Cross Highlight Excel Charts Anatomy

Before we look at the steps for building this chart, let’s understand the main components:

cross highlight excel charts

As you can see from the labelled image above, there are 3 main components: the Slicer which provides the interactivity, the Pivot Chart by Brand and the Pivot Chart by Product Category. And with some clever formatting of the Slicer and alignment of the charts they appear as one. Easy!

Tip: There is no limit to how many charts you link to the Slicer, I’ve only used two because of space limitations.

Cross Highlight Excel Charts Data

This example uses an extract of the Microsoft Contoso sample data (shown below), which is included in the file that you can download from the link under the ‘Workbook Download’ heading above.

cross highlight excel charts data

It is gross profit data by brand and product category. Notice it is formatted in an Excel Table (named Data), which is required for loading into Power Pivot in this example.

There’s also a table (named Brands) containing a distinct list of the brands:

brands table

Step 1: Load Data to Power Pivot

Select a cell in the Data table > Power Pivot tab > Add to Data Model:

load data to power pivot

Repeat for the Brands table.

Step 2: Create Relationships

Go to the Design tab > Create Relationship and set up an inactive relationship between the Brand field in the Data table and the Brand filed in the Brands table. Be sure to uncheck the ‘Active’ box in the bottom left:

create relationships

It’s this inactive relationship that allows the Slicer selection to be ignored in one of the measures (DAX Formula).

You can close the Power Pivot window now, the work here is done.

Step 3: Create the DAX Measures

Measures are the Power Pivot equivalent of a regular PivotTable Calculated Field. With Power Pivot we use the DAX formula language to write measures. You can learn more about DAX in my Power Pivot course, so I’m not going to go into detail on it here. However, you’ll see below that the formulas and functions are very similar to Excel, which makes them relatively easy to learn.

create relationships

On the Power Pivot tab > Measures > New Measure…

Total Gross Profit:

= SUM( Data[Gross Profit] )

Selected Brand:

= CALCULATE( [Sum of Gross Profit], USERELATIONSHIP( Brands[Brand], Data[Brand] ) )

Notice that the Selected Brand measure activates the relationship between the Brand and Data tables with the USERELATIONSHIP function. You’ll see why this is important in the next steps.

Step 4: Build the PivotTables

PivotTable 1: Gross Profit by Brand

PivotTable 1 Gross Profit by Brand

IMPORTANT: The ‘Brand’ field in the PivotTable must come from the Data table, not the Brands table.

Note: You can ignore the ‘Relationships may be needed’ warnings.

PivotTable 2: Gross Profit by Product Category

PivotTable 2 Gross Profit by Product Category

Step 5: Insert Slicer

The Slicer filters the brands, but it’s important that you insert the Slicer for the Brands table Brand field, not the Data table Brand field. Right-click the Brands field in the Brand table > Add as Slicer.

Tip: Click the ‘All’ tab at the top of the field list if you can’t see the Brand table listed.

insert  slicer

Remember back in step 2 we created an inactive relationship between the Brand and Data tables, then in step 3 we created the ‘Selected Brand’ measure that uses this relationship. Here is the measure again:

= CALCULATE( [Sum of Gross Profit], USERELATIONSHIP( Brands[Brand], Data[Brand] ) )

Note that the PivotTables use the Brand field from the Data table, but the Slicer uses the Brand field from the Brands table. As a result, when a brand is selected in the Slicer it only filters the ‘Selected Brand’ measure, as shown below:

selected brand

Step 6: Insert Pivot Charts

Select one of the PivotTables > PivotTable: Analyze tab > Insert PivotTable:

insert pivot charts

Choose a bar chart as this allows space for the long labels.

Repeat for the other PivotTable.

Step 7: Formatting

Now that you have the Slicer and Pivot Charts set up, the fun of formatting begins. Below is a list of the changes I’ve made, but for detailed instructions please watch the video tutorial.

Slicer Formatting:

  1. Create a custom style with the border removed and selected button set to the same dark blue as the selected bars in the charts
  2. Adjust button size to overlap the Gross Profit by Brand chart vertical axis labels
  3. Hide Slicer header
 

PivotTable Formatting:

  1. Format the Gross Profit fields to Millions with a custom number format
  2. Sort the Gross Profit by Product Category chart values in ascending order

These formats will feed through to the Pivot Charts.

Chart Formatting:

  1. Remove the chart area borders
  2. Set ‘Total Gross Profit’ series bars to light blue and ‘Selected Brand’ series bars to dark blue
  3. Add data labels to the ‘Selected Brand’ series and format their font one shade darker than the dark blue bars (one shade darker makes the font easier to read)
  4. Insert a text box for the chart title
  5. Take a screenshot of the legend and move it to the top of the Gross Profit by Product Category chart
  6. Group all objects (charts, Slicer, text box and legend image) so they’re easy to move as one object

Related Lessons

excel chart highlighting Excel Chart Highlighting

More Excel Charts Posts

burn up burn down charts

Excel Project Management Burn Down and Burn Up Charts

Excel Burn Down and Burn Up Charts are easy to make with line or scatter charts. They are useful for monitoring the progress of a project.
wee people font charts

Excel WeePeople Font Charts

Excel WeePeople Font Charts are a nice change from generic shapes for waffle charts, bar/column charts and more.
excel dot map charts

Excel Dot Map Charts

Interactive Excel dot map charts are not built-in, but with some creative use of Excel’s built-in tools we can create something unique.
highlighting data in power bi visuals

Highlighting Data in Power BI Visuals

Learn several techniques to highlight or label important data points in your Power BI visuals. Sample file and code to download.
animating excel charts

Animating Excel Charts

Use animation correctly to enhance the story your data is telling. Don't animate your chart just for some eye candy. Sample code and workbook to download.
project management dashboard

Excel Project Management Dashboard

Excel project management dashboard video tutorial covering various techniques including conditional formatting, PivotTables, Slicers, charts and more.
jitter in scatter charts

Jitter in Excel Scatter Charts

Jitter introduces a small movement to the plotted points, making it easier to read and understand scatter plots particularly when dealing with lots of data.
Custom Excel Chart Label Positions

Custom Excel Chart Label Positions

Custom Excel Chart Label Positions using a dummy or ghost series to force the label position neatly above the columns of data
Lookup Pictures in Excel

Lookup Pictures in Excel

Lookup Pictures in Excel using values in cells returned by data validation lists (drop down lists) or Slicers. No VBA/Macros required!
save chart as image

Save Chart as Image

List all the charts in your workbook then select the ones you want to save as either PNG or JPG. Sample workbook and code to download

More Excel Charts Posts

picture fill excel charts

Picture Fill Excel Charts

Using a stylish picture fill in your Excel Charts is a simple way to make your data visualizations more captivating and memorable
excel speedometer charts

Excel Speedometer Charts

How to build Excel Speedometer Charts or Gauge Charts as they're also know, why they are BAD and what to use instead.
burn up burn down charts

Excel Project Management Burn Down and Burn Up Charts

Excel Burn Down and Burn Up Charts are easy to make with line or scatter charts. They are useful for monitoring the progress of a project.
wee people font charts

Excel WeePeople Font Charts

Excel WeePeople Font Charts are a nice change from generic shapes for waffle charts, bar/column charts and more.
excel dot map charts

Excel Dot Map Charts

Interactive Excel dot map charts are not built-in, but with some creative use of Excel’s built-in tools we can create something unique.
Excel S Curve Charts

Excel S-Curve Charts

Easy Excel S-curve Charts made with PivotTables for project management. Track progress by including budget amounts.
chart axis switch

Excel Chart Axis Switch

Use radio button form controls to create an Excel chart axis switch enabling you to toggle pannel charts between same axis and own axis.

Excel Charts with Shapes for Infographics

Excel Charts with Shapes for Infographic styling and increased interest in your charts. Easy to insert but there are a few tricks required.
excel pyramid chart

Excel Pyramid Charts

Excel Pyramid charts are useful for visualising demographic data across multiple categories. Let’s look at 3 ways we can build them in Excel.

Highlighting Periods in Excel Charts

Highlighting Periods in Excel Charts helps your users interpret them more quickly and or focus their attention on a point or area.


Category: Excel ChartsTag: excel charts
Previous Post:search for data with userformSearching for Data With a User Form
Next Post:Lookup Pictures in ExcelLookup Pictures in Excel

Reader Interactions

Comments

  1. ahmed khamis

    March 11, 2022 at 4:33 pm

    good work

    Reply
    • Mynda Treacy

      March 11, 2022 at 4:55 pm

      Glad you liked it, Ahmed!

      Reply
  2. colin

    March 8, 2020 at 9:54 pm

    Hi Mynda,

    I noticed in your workbook “Regular Pivottable Solution”, the array formula ends at row 23 when “laptops” are row 24? =HLOOKUP($A$18,J2:S24,ROW(2:23),0).
    When trying to replicate this and entering =HLOOKUP($A$29,J3:S25,ROW(3:24),0) I get #REF errors. If I amend to =HLOOKUP($A$29,J3:S25,ROW(3:23),0) I get results with the exception of VCD&DVD which is #N/A. Can you please help?

    Best regards,
    Colin

    Reply
    • Mynda Treacy

      March 9, 2020 at 8:53 am

      Hi Colin,

      The purpose of the ROW function is to return the HLOOKUP row_index_num argument as an array of values from 2 to 23, because the data we want returned starts on the second row of the lookup range: J2:H24 and there are 23 rows in that range. It isn’t perfectly correlated to the row numbers in the worksheet because the PivotTable data range starts on the second row.

      I hope that clarifies things, but you can learn more about the ROW function and its uses here.

      Mynda

      Reply
  3. Matt

    February 10, 2020 at 5:37 am

    When I create the relationship between the two tables and brand columns in Power Pivot I am definitely unchecking the ‘Active’ box. However, when I insert my slicer and select a brand, it hides the Total Gross Profit figures for all the other brands. I know something is wrong because I am not getting any of the ‘Relationships may be needed’ warnings. I cannot figure out where I am going wrong having watched your video and repeating the process several times. Is it possible that a step has been missed out? I am on Office 365 version of Excel.

    Reply
    • Mynda Treacy

      February 10, 2020 at 8:40 am

      Hi Matt,

      I suspect the deselection of ‘Active’ didn’t stick. If you edit the relationship you should see the Active box is still checked. Uncheck it and everything should work as intended.

      Mynda

      Reply
  4. jim

    February 6, 2020 at 10:42 pm

    Brilliant!

    I can certainly do this but its unlikely I’d have had the initial inspiration to think of doing so
    I will try to use Dynamic Arrays instead of pivots, so refreshing for new data is unnecessary, when I shamelessly copy this idea for my own use (you will, of course, get credit)

    jim

    Reply
    • Mynda Treacy

      February 7, 2020 at 7:43 am

      Thanks, Jim! Glad you’ll have a use for it.

      Reply
  5. Jane

    February 6, 2020 at 8:11 pm

    Following along with this. When you have the slicer and apply the filter, your filter just fills in information for the brands that have products and leaves the rest of the products visible but with no value. My filter hides every product that has no entries for that brand. Have I missed a setting somewhere?

    Reply
    • Mynda Treacy

      February 6, 2020 at 10:20 pm

      It sounds like you maybe haven’t set up the relationship as inactive.

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Current ye@r *

Leave this field empty

Sidebar

More results...

Featured Content

  • 10 Common Excel Mistakes to Avoid
  • Top Excel Functions for Data Analysts
  • Secrets to Building Excel Dashboards in Less Than 15 Minutes
  • Pro Excel Formula Writing Tips
  • Hidden Excel Double-Click Shortcuts
  • Top 10 Intermediate Excel Functions
  • 5 Pro Excel Dashboard Design Tips
  • 5 Excel SUM Function Tricks
  • 239 Excel Keyboard Shortcuts

100 Excel Tips and Tricks eBook

Download Free Tips & Tricks

Subscribe to Our Newsletter

Receive weekly tutorials on Excel, Power Query, Power Pivot, Power BI and More.

We respect your email privacy

Guides and Resources

  • Excel Keyboard Shortcuts
  • Excel Functions
  • Excel Formulas
  • Excel Custom Number Formatting
  • ALT Codes
  • Pivot Tables
  • VLOOKUP
  • VBA
  • Excel Userforms
  • Free Downloads

239 Excel Keyboard Shortcuts

Download Free PDF

Free Webinars

Excel Dashboards Webinar

Watch our free webinars and learn to create Interactive Dashboard Reports in Excel or Power BI

Click Here to Watch Now

mynda treacy microsoft mvpHi, I'm Mynda Treacy and I run MOTH with my husband, Phil. Through our blog, webinars, YouTube channel and courses we hope we can help you learn Excel, Power Pivot and DAX, Power Query, Power BI, and Excel Dashboards.

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk – For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.