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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Magellan2022
Helper I
Helper I

Deneb Visuals Cross-Filtering Only One Way

Hello,

 

I've created two Deneb visuals starting out with a simple bar-chart with the same measures used in each but each with different granularities. One is at a Team level category and the other is at a Contributor level category. I have a Power BI table visual that is being cross-filtered when a bar is selected from either one of the Deneb visuals. However when selecting a row in the table visual, the cross-filtering doesn't execute/impact the other two Deneb visuals. Also, a Deneb visual won't cross-filter the other Deneb visual or vice versa...only the table visual is being cross-filtered.

 

The Power BI Interactivty settings of both Deneb visuals are all checked and the data point limit is set to 250 and no warnings are appearing either.

 

Below is the Vega-lite code that I'm using if it helps...

{
  "data": {"name": "dataset"},
  "width": {"step": 60},
  "params": [
    {"name": "bwActual", "value": 0.8},
    {"name": "bwDelta", "value": 0.4},
    {"name": "bwTick", "value": 1},
    {
      "name": "MeasureVar",
      "value": "datum['Variance']"
    }
  ],
  "transform": [
    {
      "calculate": "datum['Actual'] >= datum['Budget']",
      "as": "delta_positive"
    },
    {
      "calculate": "datum['delta_positive'] ? '#BAD9B1':'#E3BFBF'",
      "as": "delta_bar_color"
    },
    {
      "calculate": "datum['delta_positive'] ? 'bottom': 'top'",
      "as": "actual_label_baseline"
    },
    {
      "calculate": "datum['delta_positive'] ? 'black': 'white'",
      "as": "actual_label_color"
    },
    {
      "calculate": "datum['delta_positive'] ? -4: 4",
      "as": "actual_label_offset"
    }
  ],
  "layer": [
    {
      "mark": {
        "type": "bar",
        "width": {
          "expr": "bandwidth('x') * bwActual"
        },
        "tooltip": true,
        "style": "bar_actual"
      },
      "encoding": {
        "y": {
          "field": "Actual"
        },
        "opacity": {
          "condition": {
            "test": {
              "field": "__selected__",
              "equal": "off"
            },
            "value": 0.3
          },
          "value": 1
        },
        "tooltip": [
          {"field": "Team","type":"nominal"},
          {"field": "Budget","type":"quantitative"},
          {"field": "Actual","type":"quantitative"},
          {"field": "Variance","type":"quantitative"}
          ]
      }
      },
    {
      "description": "Budget Delta Bar",
      "mark": {
        "type": "bar",
        "width": {
          "expr": "bandwidth('x') * bwDelta"
        },
        "xOffset": {
          "expr": "(bandwidth('x') * (bwActual - bwDelta))/2"
        },
        "opacity": 1,
        "tooltip": true,
        "color": {
          "expr": "datum['delta_bar_color']"
        }
      },
      "encoding": {
        "y2": {
          "field": "Budget"
        },
        "tooltip": [
          {"field": "Team","type":"nominal"},
          {"field": "Budget","type":"quantitative"},
          {"field": "Actual","type":"quantitative"},
          {"field": "Variance","type":"quantitative"}
          ]
      }
      
    },
    {
      "description": "Gross Profit Budget Tick",
      "mark": {
        "type": "tick",
        "orient": "horizontal",
        "tooltip": true,
        "color": "orange",
        "opacity": 1,
        "thickness": 3,
        "width": {
          "expr": "bandwidth('x') * bwTick"
        }
      },
      "encoding": {
        "y": {
          "field": "Budget"
        },
        "tooltip": [
          {"field": "Team","type":"nominal"},
          {"field": "Budget","type":"quantitative"},
          {"field": "Actual","type":"quantitative"},
          {"field": "Variance","type":"quantitative"}
          ]
      }
    }
  ],
  "encoding": {
    "x": {
      "field": "Team",
      "type": "nominal",
      "axis": {"title": null}
    },
    "y": {
      "field": "Actual",
      "type": "quantitative",
      "axis": {"title": null}
    }
  }
}

 

1 ACCEPTED SOLUTION
Magellan2022
Helper I
Helper I

Figured it out...the Edit interactions was the solution. Can't believe I missed that.

View solution in original post

1 REPLY 1
Magellan2022
Helper I
Helper I

Figured it out...the Edit interactions was the solution. Can't believe I missed that.

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors