Counting in Powerpivot

one3nine0

Board Regular
Joined
Jul 21, 2014
Messages
127
So I have two tables linked in Powerpivot by type

Table 1 has columns for date, person, and type

Table 2 has columns for type and cost

I want to have a count for each type in table 1 to show up in a new column on table 2

After searching, many people have had success with =CALCULATE(COUNT(table 1 date), filter(table 1, table 1 type=table 2 type))
But for me all this returns is the total number of rows in table 1 for every type, not the actual count of them.

I know i can use a pivot table to count, but I will not be able to use those values in further calculations which is what I am going for.

Also, completely new to Powerpivot... just upgraded
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
You could make a calc column like this or better make a measure COUNT(table1[type]) and let the pivot table do the rest

=CALCULATE(COUNT(table1[type]),FILTER(table1,table1[type]= table2[type]))
 
Upvote 0
Likely, all you really want is:
Person Count := COUNTROWS(PersonTable)

Assuming you have a relationship setup between your two tables... the count will be correct for any row within the Type table.
 
Upvote 0

Forum statistics

Threads
1,215,013
Messages
6,122,694
Members
449,092
Latest member
snoom82

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