Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin 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.
Hello,
I have a few tables, all with different names (let's say Question1, Question2 etc - it's survey data), but each containing the same named fields:
Respondent ID
Attribute
Value
I'd like to create a single visual, with slicer allowing the user to select which table's data they want to use. I have a hunch this could possibly be achieved with parameters, but I've got myself confused about exactly how.
Any ideas welcome! Thanks.
Solved! Go to Solution.
Hi @s--turn
Sounds like you need to UNION here which will help you to slice and dice
https://learn.microsoft.com/en-us/dax/union-function-dax
Regards,
Ritesh
Thanks so much, both @Jaywant and @ribisht17 ! Jaywant - reading your solution was so interesting and taught me some things I didn't know before. I was all poised to try it - and then Ribisht17 came in with an incredibly simple idea which I couldn't resist, and which solves the problem perfectly! (I've actually used Append in Power Query rather than UNION in DAX, with an extra column for the query name, but same principle). Thanks so much, both of you 🙂
To create a single visual that allows users to select the table's data they want to use based on a slicer, you can utilize Power BI's query parameters. Here's how you can achieve this:
Open Power Query Editor from the Home tab in Power BI Desktop.
Create a new query by selecting "New Source" and choosing "Blank Query".
In the formula bar, define the following query to retrieve the list of table names:
TableNames = {"Question1", "Question2", "Question3"} // Replace with actual table names
Modify the list of table names to match your specific table names. You can add as many table names as required.
Close and apply the changes to create the query.
Now, go to the "Home" tab and click on "Manage Parameters".
In the Manage Parameters dialog box, click on "New Parameter" to create a new parameter.
Configure the parameter with the following settings:
Click OK to create the parameter.
Next, create a new query by selecting "New Source" and choosing "Blank Query".
In the formula bar, define the following query to retrieve the selected table based on the parameter:
SelectedTable = Table.SelectRows(Excel.CurrentWorkbook(){[Name=Parameters[SelectTable]{0}[Value] & "_Table"]}[Content], each true)
This query uses the parameter value to dynamically select the table by appending "_Table" to the parameter value.
Close and apply the changes to create the query.
Now, you can create your visual (e.g., a table or chart) using the "SelectedTable" query as your data source.
Add a slicer visual to your report canvas and select the "SelectTable" parameter as the field for the slicer.
When users interact with the slicer, the visual will automatically update to display the data from the selected table.
By using query parameters, you can dynamically switch between different tables and have a single visual that adapts to the user's selection.
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi @s--turn
Sounds like you need to UNION here which will help you to slice and dice
https://learn.microsoft.com/en-us/dax/union-function-dax
Regards,
Ritesh
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
64 | |
63 | |
54 | |
38 | |
25 |
User | Count |
---|---|
84 | |
60 | |
45 | |
41 | |
39 |