Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I am creating a dashboard that is connected to a SQL database. There are several different filters which the user can filter on and the existing tables in the database will be filtered and displayed.
I want to also generate a SQL query from the dashboard and display the resulting table. I am able to write the query I want in the Advanced Editor which makes a new table and display the information. However, within the SQL query I want certain values to be passed based on the current value in the slicer. Is this possible? If so how should I go about doing this?
I am also open to using other input forms besides a slicer. Due to the size of the data, I cannot do a JOIN query and then use the slicer to filter the data. I want to do a JOIN query with a WHERE clause and pass the slicer values into the WHERE clause. An example is below:
SELECT table1.col2, table1.col3, table2.col3
FROM table1
LEFT JOIN table2 ON table1.col1 = table2.col1
WHERE table1.col2 = <VALUE FROM SLICER> AND table1.col4 = <VALUE FROM DIFFERENT SLICER>
Appreciate any insights on this, thanks!
Solved! Go to Solution.
Hi @ashukla2,
You can affect the SQL query using parameters which in turn affects the data model and the visuals but is not the other way around. Slicer values cannot be passed on to a SQL query. What you can do is load the data with all the needed rows and use the values from those columns in a slicer/s.
Hi @ashukla2,
You can affect the SQL query using parameters which in turn affects the data model and the visuals but is not the other way around. Slicer values cannot be passed on to a SQL query. What you can do is load the data with all the needed rows and use the values from those columns in a slicer/s.
This should be possible using parameters.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 66 | |
| 47 | |
| 43 | |
| 26 | |
| 19 |
| User | Count |
|---|---|
| 198 | |
| 126 | |
| 102 | |
| 68 | |
| 51 |