Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Unduplicated (Distinct) Headcount by Date & Cumulative Unduplicated (Distinct) Headcount as of Date

Hi,

 

New to PowerBI, I am tasked with reporting two measures: Unduplicated (Distinct) Headcount by Date & Cumulative Unduplicated Headcount as of Date.

 

I am working with enrollment data in which students (ColleagueID) can add and drop multiple courses throughout the registration period.

 

Thank you in advance for your assistance.  Following is an example of the input data:

 

acadCredIDcolleagueIDCourseNameStatusDate
1234MATH1234MATHLESLIEADD11/20/2019
1234ENGL1234ENGLLESLIEADD11/20/2019
1234MATH1234MATHLESLIEDROP11/20/2019
1234ENGL1234ENGLLESLIEDROP11/20/2019
1235CHEM1235CHEMJAKEADD11/20/2019
      
1234MATH1234MATHLESLIEADD11/21/2019
      
1236ACCT1236ACCTMADDIEADD11/22/2019
1237CHEM1237CHEMBRETTADD11/22/2019
1237ACCT1237ACCTBRETTADD11/22/2019
      
1236MATH1236MATHMADDIEADD11/23/2019
1236CHEM1236CHEMMADDIEADD11/23/2019
1237MATH1237MATHBRETTADD11/23/2019
1234MATH1234MATHLESLIEDROP11/23/2019

 

Following is an example of the desired reporting result:

 

DateDaily Unduplicated HeadcountCumulative Unduplicated Headcount
11/20/201911
11/21/201912
11/22/201924
11/23/201903

 

A

3 REPLIES 3
tamerj1
Super User
Super User

Hi @Anonymous ,
Please refer to link to download the sampel file with solution https://www.dropbox.com/t/TsYYUdiIA2R9Sh3g
Mesures are

 

Daily Unduplicated Headcount = 
VAR AddedList =
    SELECTCOLUMNS (
        FILTER ( 
            Registration,
            Registration[Status] = "ADD"
        ),
        "@ID", Registration[colleagueID]
    )
VAR AddedCount =
    COUNTROWS ( DISTINCT ( AddedList ) )
VAR DroppedList =
SELECTCOLUMNS (
    FILTER ( 
        Registration,
        Registration[Status] = "DROP"
    ),
    "@ID", Registration[colleagueID]
)
VAR DroppedCount =
    COUNTROWS ( DISTINCT ( DroppedList ) )
VAR Result =
    AddedCount - DroppedCount
RETURN
    Result

 

And

 

Cumulative Unduplicated Headcount = 
VAR CurrentDate = MAX ( Registration[Date] )
VAR Result =
    CALCULATE ( 
        SUMX ( 
            VALUES ( Registration[Date] ),
            [Daily Unduplicated Headcount1]
        ),
            Registration[Date] <= CurrentDate
    )
RETURN
    Result 

 

Please let me know if this satisfies your requirement. If so please consider marking this reply as accepted. Thank you

Anonymous
Not applicable

Did you figure this one out? I have the same question. Thanks

Anonymous
Not applicable

Hi @Anonymous , 

 

Can you explain why the Daily Unduplicated Headcount  = 0 for the 23-nov-2019?

 

regards, 

 

Jan 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.