This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
I have this SQL query that has two statements in it. The first statement is straight forward but then it's separated by an OR to the second statement that has an AND statement in it. I can't figure out how to translate this into the Power Query without PBI combining the statements.
Here is the original SQL statement:
select I.INVENTORYID, I.SKU, b.BRANDNAME, I.MPN, I.SHORTDESCRIPTION, I.BINLOCATION, I.INSTOCK, I.INACTIVE
from inventory i inner join brands b on i.BRANDID = b.brandid
where isnull(i.INSTOCK,0) <> 0
or (i.BINLOCATION is not null and isnull(i.INACTIVE,0) = 0)
order by i.BINLOCATION, i.SKU
The or & and that are bolded and underlined are what I am having issues with.
Can you help me with understanding how to do these statements in PBI.
Thanks!
Solved! Go to Solution.
Hi @chelsweigandt ,
If you want to do the steps in Query Editor after getting the data, you can follow this:
https://powerbi.microsoft.com/en-us/blog/pull-data-from-sql-server-with-power-bi-designer/
Proud to be a Datanaut!
Private message me for consulting or training needs.
@chelsweigandt - Can you not just used the Advanced mode of the SQL connector to just paste in your SQL code?
Hi @chelsweigandt ,
If you want to do the steps in Query Editor after getting the data, you can follow this:
https://powerbi.microsoft.com/en-us/blog/pull-data-from-sql-server-with-power-bi-designer/
Proud to be a Datanaut!
Private message me for consulting or training needs.
@collinq That worked! Thanks so much! I had to take out the last bit of the SQL statement (order by i.BINLOCATION, i.SKU) but once I did that it, it worked perfectly. Thanks so much
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 41 | |
| 40 | |
| 36 | |
| 22 | |
| 15 |
| User | Count |
|---|---|
| 75 | |
| 61 | |
| 34 | |
| 30 | |
| 25 |