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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Cumulative Distinct Count within Time Series / Running totals

@v-piga-msft I edited my post to reflect my desired output. 

 

 

Hi Forum,

 

I'm struggeling to find a solution for the following problem: I want to count the first occurrence of "User ID" and also display its cumulative sum over the time.

 

I achieve to get the first occurrence by using the following column:

First Occurrence = CALCULATE(FIRSTNONBLANK(Report[Transcript Completed Date];1);ALLEXCEPT(Report;Report[User ID]))

 

I'm struggeling to get the cumulative distinct counts.

A solution would be to create a new table with only the unique values, which already worked. However, I want to use the same table though, in order to use the same slicer in the report.

 

 

My data looks like this: 

 

Transcript Completed Date

User ID

07.13.2017 08:18 AM

name@client_1.com

10.21.2016 12:15 PM

name@client_1.com

02.19.2018 08:45 AM

name@client_1.com

05.11.2016 12:00 AM

name@client_1.com

08.14.2018 02:30 PM

name@client_2.com

08.29.2018 06:48 AM

name@client_2.com

11.30.2017 02:28 PM

name@client_2.com

02.02.2018 11:36 AM

name@client_2.com

03.22.2018 01:14 PM

name@client_2.com

06.25.2017 05:39 PM

name@client_2.com

03.29.2018 04:41 PM

name@client_3.com

04.16.2018 02:23 PM

name@client_3.com

04.13.2018 02:35 PM

name@client_3.com

05.19.2018 12:28 PM

name@client_3.com

08.04.2018 04:32 PM

name@client_4.com

09.01.2018 09:26 PM

name@client_4.com

03.06.2018 10:20 PM

name@client_4.com

08.30.2017 12:58 PM

name@client_4.com

 

 

Desired output for a visual.

 

Cumulative Unique User

Uniqe User

2016

1

1

2017

3

2

2018

41

 

 

I was looking through the forum already, but am not able to find the correct solution.

 

Thanks in advance 🙂

1 ACCEPTED SOLUTION
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

Based on your First Occurrence column, you could create another two measures with the formula below to achieve your desired output.

 

Unique user =
CALCULATE (
    COUNT ( Report[Transcript Completed Date] ),
    ALLEXCEPT ( Report, 'Report'[User ID] ),
    FILTER (
        'Report',
        'Report'[Transcript Completed Date] = 'Report'[First Occurrence]
    )
)

Cumulative Unique User =
CALCULATE (
    [Unique user],
    FILTER (
        ALL ( 'Report' ),
        'Report'[Transcript Completed Date]
            <= MAX ( 'Report'[Transcript Completed Date] )
    )
)

Here is your desired output.

 

Capture.PNG

 

 

 

 

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

Based on your First Occurrence column, you could create another two measures with the formula below to achieve your desired output.

 

Unique user =
CALCULATE (
    COUNT ( Report[Transcript Completed Date] ),
    ALLEXCEPT ( Report, 'Report'[User ID] ),
    FILTER (
        'Report',
        'Report'[Transcript Completed Date] = 'Report'[First Occurrence]
    )
)

Cumulative Unique User =
CALCULATE (
    [Unique user],
    FILTER (
        ALL ( 'Report' ),
        'Report'[Transcript Completed Date]
            <= MAX ( 'Report'[Transcript Completed Date] )
    )
)

Here is your desired output.

 

Capture.PNG

 

 

 

 

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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