cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Filter in DBX dashboards

nehaa
New Contributor II

How to add a column from Table1 as a filter to Table2 (Also called as on-click action filter) in databricks Dashboards?
Both the tables are getting data through sql query 

1 REPLY 1

Walter_C
Honored Contributor
Honored Contributor

To add a column from Table1 as a filter to Table2 in Databricks Dashboards, you can use the dashboard parameters feature. Here are the steps:

  1. Create a visualization for each of your SQL queries. You can do this by clicking the '+' next to the Results tab and selecting Visualization. Save your visualizations.

  2. Create a dashboard using these visualizations. You can add a second widget to the dashboard from the Add drop-down list and select the appropriate query.

  3. Add a dashboard parameter to each query. This is done by adding a WHERE clause to your SQL query to filter the query by the desired column. For example, if you want to filter by a column named 'column1' from Table1, you would add this clause before the GROUP BY clause: WHERE column1 IN ({{ column1 }}).

  4. Update the dashboard to use the dashboard parameter. Open your dashboard, and for each visualization, click the kebab menu and then click Edit. In the Parameters section, click the pencil icon for the Widget parameter in the Value field. Change the Source to New dashboard parameter.

  5. Verify that 'column1' is selected as the Key value. Click OK and then click Save. The widget parameter for the visualization should no longer appear.

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!