If there is a column of your spreadsheet that is unique (no other formulas or values in the column) to your Pivot Table (Let’s use column B for example), then you could simply use the =COUNT(B:B) or COUNTA(B:B) to get the total number of rows.

You may want to make adjustments for headers and grand totals, such as =COUNT(B:B)-n .

Dealing with SubTotals is a whole other issue!

]]>GREAT resource.

Here’s an easy one, how can I determine the number of rows in a pivot table without using VBA? Is there an excel formula I can use that can do it simply?

My issue is I have a pivot that varies based on a category selected. E.g. category A might return 100 rows and 10 columns and category B might return 90 rows and 7 columns.

=rows() obviously doesn’t take a pivot table as a reference so it’s not dynamic.

Thanks in advance

]]>excellent piece of work here, and you have explained it much elegantly.

vineeth

]]>Thanks,

Kasper

as FIRSTNONBLANK already does a context switch I think the calculated column is not necessary:

[Revenue Base Month]:=CALCULATE(

[SumSA],

CALCULATETABLE(

FIRSTNONBLANK(‘DateTable’[Month], [SumSA]),

ALLEXCEPT(‘DateTable’, ‘DateTable’[FyYear])),

ALLEXCEPT(‘DateTable’, ‘DateTable’[FyYear])

)

what do you think about it?

]]>