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

Join 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.

Reply
Anonymous
Not applicable

Power Query - Identify Number Columns with Zero Values

Hi,

 

I'm trying to identify rows over values that have zero values so I can filter out these rows. To do this, I need to identify my number columns and search only those. There will be text columns in my data and there can be upwards of 50 different number columns, so creating a column including each individual column would be inefficient.

 

I've seen the following that could work:

= Table.AddColumn(PREVIOUS STEP, "Zero Value", each List.MatchesAll(Record.ToList(_),each _=0), type logical)

This allows me to create a logical column that I can filter. But it looks across all my columns, including those with Text.

 

The following code allows me to isolate just my number columns:

=Table.ColumnsOfType(PREVIOUS STEP, {type nullable number})

I want to know how I can blend these 2 together so my logical step only looks at my numerical columns.

 

Any idea how I would do this?

 

Thanks,

Mark

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@Anonymous try this:

 

Table.AddColumn(#"Prev Step", "Custom", each List.MatchesAll(Record.ToList(Record.SelectFields(_,Table.ColumnsOfType(#"Prev Step", {type nullable number}))),each _=0))


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@parry2k  tremendous, that's exactly what I needed. Thanks for your help!

parry2k
Super User
Super User

@Anonymous try this:

 

Table.AddColumn(#"Prev Step", "Custom", each List.MatchesAll(Record.ToList(Record.SelectFields(_,Table.ColumnsOfType(#"Prev Step", {type nullable number}))),each _=0))


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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