+ Reply to Thread
Results 1 to 5 of 5

New Measure Powerpivot Unique Count

  1. #1
    Registered User
    Join Date
    11-25-2014
    Location
    Ireland
    MS-Off Ver
    2010
    Posts
    3

    New Measure Powerpivot Unique Count

    Hi,

    I am trying to create a new measurement which would count the amount of unique document numbers, the problem is that I need to count values that are lower than -10 and values greater than +10

    'ALL CC'[DOC# CC] are the document numbers and 'ALL CC'[USD] is the related value that should be lower than -10 or greater 10.

    So far I came up with the following formula, but it is counting document numbers that have both plus and minus transactions twice.

    =CALCULATE(COUNTROWS(DISTINCT('ALL CC'[DOC# CC])),'ALL CC'[USD]>10)+CALCULATE(COUNTROWS(DISTINCT('ALL CC'[DOC# CC])),'ALL CC'[USD]<-10)

    is there a quick fix to this formula?

    Thanks in advance

  2. #2
    Forum Contributor
    Join Date
    07-16-2013
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2013
    Posts
    176

    Re: New Measure Powerpivot Unique Count

    Can you just simply add the document number to the values field and select distinct count? Or do you need to reference this calculation for other formulas?

  3. #3
    Valued Forum Contributor Melvinrobb's Avatar
    Join Date
    06-19-2012
    Location
    Manitoba, Canada
    MS-Off Ver
    Excel 2013
    Posts
    1,128

    Re: New Measure Powerpivot Unique Count

    make a calculated column that uses the ABS function, so that -10 and +10 are both +10.

    Then a calculate function referencing this new calculated columns should work.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Please click the * icon below if I have helped.

  4. #4
    Registered User
    Join Date
    11-25-2014
    Location
    Ireland
    MS-Off Ver
    2010
    Posts
    3

    Re: New Measure Powerpivot Unique Count

    Thank you very much! I did not think of absolute values. DISTINCTCOUNT did not work for me but the following formula using ABS did


    =CALCULATE(COUNTROWS(DISTINCT('ALL CC'[DOC# CC])),ABS('ALL CC'[USD])>10)

  5. #5
    Valued Forum Contributor Melvinrobb's Avatar
    Join Date
    06-19-2012
    Location
    Manitoba, Canada
    MS-Off Ver
    Excel 2013
    Posts
    1,128

    Re: New Measure Powerpivot Unique Count

    I think DISTINCTCOUNT was added to 2013, rather than having to nest COUNTROWS and DISTINCT, as you need to do in 2010.

    An alternative is to include "||" in the formula, which works as an or:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Powerpivot table add new measure
    By Kevin_M in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-29-2014, 07:36 AM
  2. Powerpivot Calculated Measure to remove blanks from pivot table/chart
    By hbusche in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 07-17-2013, 01:23 PM
  3. [SOLVED] Powerpivot Rolling Average Calculated Measure
    By hbusche in forum Excel Charting & Pivots
    Replies: 8
    Last Post: 07-15-2013, 06:46 PM
  4. PowerPivot Measure Formula
    By Twi78 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-28-2012, 08:45 AM
  5. Replies: 1
    Last Post: 11-29-2011, 10:52 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1