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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Filtering out '0' in two columns to bring back results only with a numbers

 Hi

I'm trying write a measure to get results back from a table (looking at two columns) which counts only the results which have a number in one or both columns , ignoring anything with '0' in both columns. If I was using excel I would filter out the two columns which have '0' in both cells, leaving me with the columns that have a number in both, or a number in one and '0' in the other. I do not want to include results that have a zero in both columns only. The measure I have written is

= COUNTROWS(FILTER('Cycle Counts','Cycle Counts'[Cycle Count Qty. (Calculated)]<>0) & COUNTROWS(FILTER('Cycle Counts','Cycle Counts'[Cycle Count Qty. (Phys. Inventory)]<>0)))
I get an error back to say the parameter is not correct and also that'multiple columns cannot be to a scalar value.
I am very new to this hence the multiple errors and have zero practice at writing measures
1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

Please try this measure out.

 

= COUNTROWS(FILTER('Cycle Counts','Cycle Counts'[Cycle Count Qty. (Calculated)]<>0 && 'Cycle Counts'[Cycle Count Qty. (Phys. Inventory)]<>0))

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

5 REPLIES 5
camargos88
Community Champion
Community Champion

Hi @Anonymous ,

 

Try it using COUNTX:

https://docs.microsoft.com/pt-br/dax/countx-function-dax



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

Proud to be a Super User!



Anonymous
Not applicable

Hi- unfortunately I don't know if. this would have worked as the link looked like it was in Spanish. I did get a solution though, and thank you for replying.

mahoneypat
Microsoft Employee
Microsoft Employee

Please try this measure out.

 

= COUNTROWS(FILTER('Cycle Counts','Cycle Counts'[Cycle Count Qty. (Calculated)]<>0 && 'Cycle Counts'[Cycle Count Qty. (Phys. Inventory)]<>0))

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

Hi Pat

 

Many thanks, this one worked!

FabricLearnFabr
Regular Visitor

How do you use this measure to filter out the data?

 

Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (27)