Problems with pivot and calcuated fields!

hakanfa

New Member
Joined
Mar 25, 2020
Messages
36
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I have a major problem with Pivot – here a short description. I’m trying to calculate how many units per departure we have on a ferry. The raw data looks like following:
DateMonthTimeProductLengthAmountDepartures
23.3.2020March18:30CAR621
23.3.2020March18:30VAN821
23.3.2020March18:30CARAVAN1241
23.3.2020March20:30CAR6201
23.3.2020March20:30VAN881

Now if I make a calculated field for units per departure I get for the 18:30 8 units on 3 departures – but the correct value would be 8 units on 1 departure, and for the 20:30 I get 38 units on 2 departures when the correct answer would be 28 units on 1 departure. How could I make the pivot table understand the logic Im looking for?


All possible help and thoughts are appreciated!
Hakan
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Hihakanfa,

A pivot will see the rows of your raw data as single records. And thus count 3 departures whereas you know it is one.
Either upgrade to "PowerPivot" useing DAX measures or easier add an extra column in your raw data that forces the unique count.

Something like

1585159555915.png
 
Upvote 0
Hihakanfa,

A pivot will see the rows of your raw data as single records. And thus count 3 departures whereas you know it is one.
Either upgrade to "PowerPivot" useing DAX measures or easier add an extra column in your raw data that forces the unique count.

Something like

View attachment 9786
Thank you for valuable comments - I solved this by swapping to PowerPivot an adding a "calculated measure". First I added an extra column with an unique value for the departures (DepID). Then I created a "calculated measure" = SUM(Meters)/DISTINCTCOUNT(DepID) works like a charm :D
 
Upvote 0

Forum statistics

Threads
1,214,824
Messages
6,121,784
Members
449,049
Latest member
greyangel23

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