Share via

Pivot table filtering on distinct values

Anonymous
2019-01-21T17:37:25+00:00

I am using a pivot table, and need to have it return the Distinct value for the Units.  So for example - for grouping #1 below - I need to get 500, and not the sum of that.  If I use the average, min, or max, I get the right value, but then the sub-totals and grand totals are based on the average/min/max of all the grouping, and not the sum of groups 1 to x.  I am not an expert, and tried putting into a data model, but then I could not add my own calculated fields

Grouping Sum of Units Sum of Total
group 1 6,000 $     98,000

This is a sample of ONE set of data.  There are columns not shown that get to the sum of the total that are not shown

Grouping Units Year 3 total
group 1 500 50000
group 1 500 60000
group 1 500 70000
group 1 500 10000
group 1 500 15000
group 1 500
group 1 500
group 1 500
group 1 500
group 1 500
group 1 500
group 1 500
Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Ashish Mathur 101.9K Reputation points Volunteer Moderator
2019-01-22T00:20:21+00:00

Hi,

I have solved this with the PowerPivot.  You may download my solution workbook from here.

Hope this helps.

Was this answer helpful?

0 comments No comments

7 additional answers

Sort by: Most helpful
  1. Anonymous
    2019-02-04T14:11:18+00:00

    Hi,

    try this , create a helper column named mysum and enter this formula into C2 then copy down =B2/COUNTIF($A$2:$A$13,A2)

    now create pivot table >move Grouping field into Rows and my sum field into Values,

    See snapshot for illustration

    Hope it may helps you 

    Regards

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2019-01-25T06:58:14+00:00

    Hi pmw0813,

    Have you referred to measure provided by Ashish? Please let us know, if you still need any help.

    @Ashish, thanks for providing the solution.

    Regards,

    Chitrahaas

    Was this answer helpful?

    0 comments No comments
  3. Ashish Mathur 101.9K Reputation points Volunteer Moderator
    2019-01-22T23:36:15+00:00

    Hi,

    This is the measure I have written

    =if(HASONEVALUE(Data[Grouping]),MIN(Data[Units]),SUMX(SUMMARIZE(VALUES(Data[Grouping]),[Grouping],"ABCD",MIN(Data[Units])),[ABCD]))

    Hope this helps.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2019-01-22T15:46:35+00:00

    We are not allowed to access onedrive externally -

    Was this answer helpful?

    0 comments No comments