Forum Discussion

chelsweigandt's avatar
chelsweigandt
Regular Visitor
6 years ago
Solved

SQL Statement Translation to Power Query

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!

 

 

4 Replies