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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
PowerBIzNess
Frequent Visitor

Cumulative Distinct Count by Month

Hello, 

 

This is driving me crazy and is probably something simple that I'm overlooking..

 

Trying to create a calculated column that counts the distinct # of employees to date. 

 

         Curent Count        Cumulative Count

Jan - 2 Employees          2

Feb - 2 Employees         4

Mar - 2 Employees        6

 

For some reason the cumulative numbers aren't working out. 

 

Calculated Formula: 

 

Cumulative = 
CALCULATE (
DISTINCTCOUNT( [Employee] ),
FILTER (
ALL('YTD Attrition'),
[Term Date] <= MAX ( [Term Date] )
)
)

 

Here's what it looks like:

 

Capture.PNG

 

Thanks in advance!

10 REPLIES 10
bkhalidp
New Member

I am trying to add a cumulative line graph for DISTINCT count by Document No over days / month / year. The Document No is repeated multiple times as it goes through various stages of review. I want to have a cumulative line graph for first stage and another cumulative line graph for final stage. Would appreciate  your help. 

Hi,

Share some data and show the expected result in a simple table format.  Share data in a format that can be pasted in an MS Excel file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

@PowerBIzNess,

You can download my PBIX file to test.

Regards,
Lydia

Anonymous
Not applicable

@PowerBIzNess,

You can use the following DAX to calculate cumulative. Make sure that  you choose "Don't summarize" for cumulative column in table visual.

Cumulative = CALCULATE(DISTINCTCOUNT('YTD Attrition'[Employee]),ALL('YTD Attrition'),'YTD Attrition'[Term Date]<=EARLIER('YTD Attrition'[Term Date]))

1.JPG

Regards,
Lydia

@Anonymous

 

thanks so much for the reply. I realized my issue was the summarization in the visual, which displayed correctly when I selected 'Average'. For some reason the 'Don't Summarize' option doesn't appear as an option - I think this is because in order to gather some additional metrics I unpivoted a list of columns detailing attrition reasons, which created multiple rows for the same individuals. So for example my data looks like:

 

John Doe    5/1/2017   Compensation

John Doe    5/1/2017   Relocation

John Doe    5/1/2017   Benefits

 

Any suggestions you have on improving this would be appreciated!

 

Anonymous
Not applicable

@PowerBIzNess

The DAX also works in your scenario, please check the following screenshot.
1.JPG

Regards,
Lydia

Thanks Lydia

 

What is your default summarization for the column? I don't have a 'Don't Summarize' option so I'm left having to average the numbers.

Zubair_Muhammad
Community Champion
Community Champion

@Zubair_Muhammad

 

Thanks for the reply. That made the number's a little less crazy but something is still throwing it off..

 

Capture.PNG

Hi @PowerBIzNess

 

Please could you share your file via googledrive or onedrive or copy paste dataset

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors