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.
Greetings! I want to filter rows I'm bringing into Power BI Desktop using the advanced option sql query and referencing an already-created field as part of that query.
If my large database to import/filter has a table called NewTable and I have a table already in PowerBI called SmallTable and both contain a field called CommonID, how do I write the query to Select/Import only rows from NewTable where NewTable[CommonID] is also in SmallTable[CommonID]. I can't seem to find the right syntax to enable Power BI Desktop to reference SmallTable.
Hi @MathewT ,
This is Table1:
This is Table2:
Table1 has connected to Power BI by Direct Query mode.
Please try:
SELECT Table2.* FROM Table2 INNER JOIN Table1 ON Table2.ID = Table1.ID
I think this is the result you want:
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for your response. Table1 is part of the SQL database being read in. Table2 is a table ALREADY in PowerBI. The probem is PowerBI is not recognizing the Table2 reference.
Hi @MathewT ,
On my test, Table 1 is a table already in Power BI. Table 2 is part of the SQL database being read in.
Please check again.
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
---|---|
72 | |
71 | |
55 | |
38 | |
31 |
User | Count |
---|---|
71 | |
64 | |
62 | |
50 | |
46 |