COUNTIF on entire Pivot Table Column

domtrump

Board Regular
Joined
Apr 1, 2010
Messages
245
I need to do a =COUNTIF() ">0" on an entire column in a pivot table (I can't use a range because the number of rows changes in my table). The column in question is a Measure in PowerPivot. What is the appropriate syntax?

Thanks.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
There are other things beneath the pivot table, so I can't count the WHOLE column. I just want to count the data in the column WITHIN the pivot table.
 
Upvote 0
Any ideas on how to do a COUNTIF on a single column of a power pivot table? Any help appreciated. Thanks.
 
Upvote 0
I suggest you jump over to the "main" excel help forum. You are in the Power BI forum, and we don't COUNTIF. That's for Hobos ;)
 
Upvote 0
I suggest you jump over to the "main" excel help forum. You are in the Power BI forum, and we don't COUNTIF. That's for Hobos ;)

Thanks for the response. Two questions:

1. Is there some more sophisticated way to do what I'm trying to accomplish with DAX?
2. What is proper etiquette for this forum? Do I just open a new post or is there some way to move or reference this one?

Thanks again for the help.

-Dom
 
Upvote 0
Holy smokes! I didn't even realize you had Power Pivot involved. I tuned out at COUNTIF.

In general, CALCULATE in Power Pivot is your bestest friend.
CALCULATE(COUNTROWS(SomeTable), FILTER(SomeTable, [SomeValue] > 0))

But without knowing more about your actual model/tables/columns/measures its hard to say what the actually correct measure is :)
 
Upvote 0
I think I can make that work for me. What I did is create the measure you showed me and added it to the pivot table. It created a column of 1's and 0's and produced the correct total. Since the cell where I want to show the total is outside the pivot table, I used GETPIVOTDATA on that column and it shows the number I'm interested in. Then I hid the column I added.

Does this sound like the best way to accomplish this? Thanks so much for your help.
 
Upvote 0
THat sounds reasonable, though maybe google for "dax cube formulas" and a bit better than GETPIVOTDATA.
 
Upvote 0

Forum statistics

Threads
1,215,036
Messages
6,122,794
Members
449,095
Latest member
m_smith_solihull

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top