# Countifs in PowerPivot

#### LMSF888

##### New Member
Relative newbie here to Power Pivot.

I've already scoured a few related posts of similar problems but I've struggled to see the answer to my specific issue.

I have a table relating to delivery drivers. Each row is a different "leg" of a driver's day. EG if a driver picks up a loaded van and goes out to do deliveries they will have 1 row for one particular date. If they come back and complete deliveries from a second van they appear twice on a given date. We pay subcon drivers a flat fee for 10 hours and sometimes they appear once, or twice. I need to tag on a calculated field to show their fee correctly (I'm using PP because it's faster than processing in excel and all drawn from a system driven data source). I essentially either want the full fee to appear on the first row, or alternatively show the total fee split evenly into each leg of the journey.

One thought was to try and find a formula to self identify if a row is the first one on a certain day for that driver in the table and apply the full fee there (couldn't crack it).

Another was to do a countifs on that driver for the day and divide the total fee by the returned result.

Below is an example shown in another thread, but it returns the total times the driver shows up. How would I filter based on the driver's appearances on just the specific day on the row? IN excel I'd just run an expression to say filter the date on the date shown on the current row...but I can't find how to do this online!
=calculate(COUNTROWS(Query),ALLEXCEPT(Query,Query[DriverDriverDriver]))

Any help understanding how the allexcept funtion is working above would be appreciated and also if you know of a way to apply the number to just the first row that'd be amazing too!

### Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Replies
3
Views
47
Replies
10
Views
111
Replies
3
Views
306
Replies
0
Views
191
Replies
0
Views
661

1,126,993
Messages
5,622,049
Members
415,875
Latest member
Tarali

### 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.

### Which adblocker are you using?

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

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