Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jjosorio
Regular Visitor

How to delete rows where the quantity is equal to 0

best regard
I am bringing a query from SQL Server and in the table I have a field called quantity, it is numeric and there are rows with 0; I want the information upload without 0, how was the upload done? Thank you.

 

I found the command Table.SelectRows but it does not work correctly, I do it from query editor and write the command does not work


#"Filtered Rows" = Table.SelectRows(

t_datos_ventas,

each [cantidad] = 0

)

1 ACCEPTED SOLUTION

I already found the solution. Thank you

 

let
Source = Sql.Database("x.x.x.x", "db_datos_ejemplo", [Query="select *#(lf)from t_datos#(lf)where cantidad<>0"])
in
Source

View solution in original post

3 REPLIES 3
Nathaniel_C
Super User
Super User

Hi @jjosorio ,

In Power Query, you simply filter and uncheck the zero. In my example I unchecked the 1 and ended up only with 2s.  The great thing is when you refresh, it remembers yours steps and filters. Start from the bottom of the pictures and end up with the top which is the table in Power BI.
Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathanielfilter0123.PNG

 

filter012.PNG

 

filter01.PNG

 

filter0.PNG

 

those rows. 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




 

Thank you very much for your response, but what I want to do is before the data reaches PowerBi filter by 0, that way the data arrives clean

 

In Advanced Editor I am thinking of excluding them, but I would not know how or if they have any other way I thank you

let
Source = Sql.Database("x.x.x.x", "db_ejemplo"),
dbo_t_datos = Source{[Schema="dbo",Item="t_datos"]}[Data]
in
dbo_t_datos_
)Source = Sql.Database("x.x.x.x", "db_datos_ejemplo"),
dbo_t_datos = Source{[Schema="dbo",Item="t_datos_"]}[Data]
in
dbo_t_datos_ejemplo

I already found the solution. Thank you

 

let
Source = Sql.Database("x.x.x.x", "db_datos_ejemplo", [Query="select *#(lf)from t_datos#(lf)where cantidad<>0"])
in
Source

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors