Forum Discussion

mmcanelly's avatar
mmcanelly
Icon for Helper II rankHelper II
3 years ago
Solved

Visual Interactions - visual-level filters being transferred when interacting with visual

I am running into an issue where filters that are set on one chart are transferring over to another when I interact with the chart. Here are the basics of the visuals I'm working with:

 

Visual 1: Bar Chart

  • Categorical "Business Unit" variable along y-axis and Total Sales $ along x-axis
  • A visual-level filter set to only show totals for the current period (Period = "Current")

Visual 2: Line Chart

  • Weekly dates along x-axis and total # of Customers along y-axis
  • A visual-level filter set to only show past periods (Period = "Past")

Here is the desired behavior: I want the user to be able to click one of the bars for a specific Business Unit on Visual 1, and then I want Visual 2 to filter down to show the weekly data for that Business Unit. However, what I find is happening is that in addition to filtering by Business Unit when I click the bar, it is also applying the Period = "Current" filter from Visual 1 onto Visual 2. This conflicts with the filter already set on Visual 2 (Period = "Past") and so the line chart shows no data.

 

Is there a way to only transfer info for the variable assigned to the y-axis (Business Unit) as a filter when clicking the bar on Visual 1, without also transferring all the other filters set on that visual?

  • Interactions between visuals transfer all filter context. To get around this, rather than applying a filter to your visual, you can add filter context to your measure. For example, on your first visual, remove the filter. Then write your measure something like this:
    Current Period Total Sales = CALCULATE( [TotalSales] , 'Table'[Period] = "Current" )

2 Replies

  • CoreyP's avatar
    CoreyP
    Icon for Solution Sage rankSolution Sage

    Interactions between visuals transfer all filter context. To get around this, rather than applying a filter to your visual, you can add filter context to your measure. For example, on your first visual, remove the filter. Then write your measure something like this:
    Current Period Total Sales = CALCULATE( [TotalSales] , 'Table'[Period] = "Current" )