+ Reply to Thread
Results 1 to 5 of 5

Looking to Automate Distinct Count & Prevalence Calculations

  1. #1
    Registered User
    Join Date
    11-30-2022
    Location
    Atlanta, Georgia
    MS-Off Ver
    2016
    Posts
    2

    Question Looking to Automate Distinct Count & Prevalence Calculations

    SamplePivotTable_30NOV.xlsx

    Hello! First time poster here. I've been watching YouTube video after video and can't seem to figure out how to achieve these results I'm looking for.

    I'm looking to automate the Distinct Count and Prevalence calculations of each row as seen in the worksheet. Preferably would like to learn how to do this in Power Pivot. If anyone could guide me in the right direction, I'd greatly appreciate it! Thank you in advance.

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,733

    Re: Looking to Automate Distinct Count & Prevalence Calculations

    Hello sunflowermama013 and Welcome to Excel Forum.
    Perhaps the following will help.
    1. In the data model add a Concatenate column using: =CONCATENATE(Table1[Restaurant],Table1[ID])
    2. Add a Rows column using: =COUNT(Table1[ID])
    3. Add a Distinct Count measure using: =DISTINCTCOUNT(Table1[Concantenate])
    4. Add a Prevalence measure using: =[Distinct Count]/MAX(Table1[Rows])
    5. Pull the Distinct Count and Prevalence fields into the Values area of the pivot table
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  3. #3
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Looking to Automate Distinct Count & Prevalence Calculations

    Power Query

    Please Login or Register  to view this content.
    after that create Pivot Table

    Count of Restaurant ID
    Restaurant
    1
    2
    3
    4
    5
    Grand Total
    Brusters
    1
    1
    1
    3
    Burger King
    1
    1
    1
    3
    Chick-fil-A
    1
    1
    1
    3
    Freddy's
    1
    1
    2
    McDonalds
    1
    1
    Taco Bell
    1
    1
    2
    Grand Total
    4
    4
    2
    1
    3
    14



    and then
    21%
    =K$4:K$9/GETPIVOTDATA("Restaurant ",$E$2)
    21%
    21%
    14%
    7%
    14%
    Attached Files Attached Files
    Last edited by sandy666; 12-05-2022 at 12:09 AM. Reason: file added

  4. #4
    Registered User
    Join Date
    11-30-2022
    Location
    Atlanta, Georgia
    MS-Off Ver
    2016
    Posts
    2

    Re: Looking to Automate Distinct Count & Prevalence Calculations

    Ah, thank you so much JeteMc! This worked PERFECTLY! Greatly appreciate your help!

  5. #5
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,733

    Re: Looking to Automate Distinct Count & Prevalence Calculations

    You're Welcome and thank you for the feedback. Please take a moment to mark the thread as 'Solved' using the thread tools menu above your first post. I hope that you have a blessed day.

+ 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. Automate calculations when adding new column of data
    By holdenmcgroin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-19-2022, 02:53 PM
  2. [SOLVED] Pivot Tables - Distinct Count Activated Omits Field Calculations
    By darenferg in forum Excel General
    Replies: 1
    Last Post: 01-11-2021, 01:38 AM
  3. Replies: 1
    Last Post: 08-31-2020, 11:54 PM
  4. Automate calculations on a database
    By Hb47 in forum Excel General
    Replies: 4
    Last Post: 11-12-2016, 02:10 AM
  5. Replies: 17
    Last Post: 04-11-2016, 11:14 PM
  6. [SOLVED] Automate rowing block calculations
    By plumberef in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-14-2015, 02:12 AM
  7. Automate bonus payment calculations
    By Excelbeginner1 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-22-2013, 08:31 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