This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
This report is based on a commercial software app, so the structure of the data is what it is, so there's no point in complaining about it. The data in this case is in a Oracle DB I'm accessing via ODBC.
There's 2 parts to this...
Part 1. I have a data source based on a query that gives me a series of users (schemas). The list is dynamic i.e. users can be created and dropped on a day by day basis.
Part 2. Each user has tables with the same names, so if it was not dynamic I'd create a simple union query and the job would be done, however its not. So I need to iterate through the results from Part 1 to dynamically create a unioned dataset of the different users (with a column in there that has the username).
I've tried to look at the List function and failed, Parameters as such don't look like the way to go, so I'm bit stuck on how to tackle the issue. Any advice on how to go about this would be appreciated.
Solved! Go to Solution.
Hi @Doug68 ,
If you connect to a database, Power Query will usually create some steps automatically for you. One of theses steps will usually contain a list of all tables of your database. Delete all steps that come after that.
Then, convert your list from Part 1 to a table and merge it to Part 2 in the mode of an inner join. That will act as the filter you need and return only the user tables from the list in Part1. Expanding the content will give you that unionated result.
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Hi @Doug68 ,
If you connect to a database, Power Query will usually create some steps automatically for you. One of theses steps will usually contain a list of all tables of your database. Delete all steps that come after that.
Then, convert your list from Part 1 to a table and merge it to Part 2 in the mode of an inner join. That will act as the filter you need and return only the user tables from the list in Part1. Expanding the content will give you that unionated result.
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 1 |
| User | Count |
|---|---|
| 7 | |
| 7 | |
| 6 | |
| 4 | |
| 4 |