Count of rows uptil a certain row.

floragray

New Member
Joined
Jul 22, 2013
Messages
19
Hi All

I'm really new to powerpivot and in dire need of some help!!
In the table below i need to calculate an Average COlumn
and i need to divide the ''Total Number of Customers'' by the "Count (Batch Number)" uptil that row.

Ive tried every possible formula in Powerpivot but nothing seems to work
I would be really grateful if someone could help! Thankssss!

[TABLE="width: 500"]
<tbody>[TR]
[TD]Batch Number[/TD]
[TD]Total Number of Customers[/TD]
[TD]Average(TO BE CALCULATED IN POWERPIVOT)[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]100
[/TD]
[TD]=100/1[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]200[/TD]
[TD]=200/2[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]250[/TD]
[TD]=250/3(i.e count of rows uptil that row!)[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]400[/TD]
[TD]=400/4[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]500[/TD]
[TD]=500/5[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]900[/TD]
[TD]=900/6[/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD]1000[/TD]
[TD]=1000/7[/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD]1500[/TD]
[TD]=1500/8[/TD]
[/TR]
[TR]
[TD]17[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
If your batch numbers are unique and you only to to count the rows by descending batch number then this should work as a calculated column for counting rows:

Code:
=CALCULATE(COUNTROWS(TableName), FILTER(TableName, TableName[Batch Number] <= EARLIER(TableName[Batch Number])))
 
Upvote 0

Forum statistics

Threads
1,223,958
Messages
6,175,633
Members
452,661
Latest member
Nonhle

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