Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
79 | |
78 | |
59 | |
36 | |
33 |
User | Count |
---|---|
94 | |
61 | |
56 | |
49 | |
41 |