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
roncruiser
Helper V
Helper V

DAX Formula: For each Row, Count the Cells Whose Sum = 0

Hi,

 

I've been working on and off on this one for awhile now but it has me duped.  It seem like it should be simple.  It probably is, but i cannot get it.   I keep getting the count of cells that contain zero which is not what I need.  BTW, I'm looking for a DAX formula.

 

File contained here:

https://drive.google.com/file/d/1tFF3WBXw8oUbkD92BiSUooqS4UYUVnoq/view?usp=sharing

Look in tab labeled "Pivot Table":

 

Objective:

For each row, count the cells whose sum = 0.  In other words, for each vref setting, count the cells whose sum = 0.

(Not to be confused with the count of cells that contain zero.)  So, along the right side of the table, there will be column that shows the count of cells with the sum = 0.

 

Thanks....

 

 

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@roncruiser ,

 

You may check if the post below helps.

https://community.powerbi.com/t5/Desktop/Need-count-for-matrix-non-zero-values/m-p/406361#M186090

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-chuncz-msft
Community Support
Community Support

@roncruiser ,

 

You may check if the post below helps.

https://community.powerbi.com/t5/Desktop/Need-count-for-matrix-non-zero-values/m-p/406361#M186090

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I'll post another query to capitolize on the solution.

 

It requires counting zeroes on the left and on the right of the zero CDC (Coarse+Fine) reference. Thanks again.

@v-chuncz-msft 

 

Your solution did help!  Thank you.

Based on the thread you pointed to.  Specific to my application the solution is:

 

=IF (
HASONEVALUE ( raw_data[CDC (Coarse+Fine)]),
SUM ( raw_data[Value] ),
COUNTROWS (
FILTER ( VALUES ( raw_data[CDC (Coarse+Fine)]), CALCULATE ( SUM ( raw_data[Value] ) ) = 0 )
)
)

 

Columns for both Subtotals and Grandtotals need to show.

 

Thank you. 

 

 

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.