The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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.
Proud to be a Super User!
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.
Proud to be a Super User!
This should be possible using parameters.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
94 | |
88 | |
71 | |
65 |
User | Count |
---|---|
241 | |
124 | |
120 | |
81 | |
79 |