Countifs in PowerPivot

LMSF888

New Member
Joined
Dec 14, 2020
Messages
1
Office Version
  1. 365
Platform
  1. Windows
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!
 

Some videos you may like

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)

Watch MrExcel Video

Forum statistics

Threads
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.
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
Top