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

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

Reply
Anonymous
Not applicable

Count of current month active minus count of previous month active plus count of current month exit

I have a FACT_GTO table used to present a distinct count of CandidateID monthly (via a DIM_calendar table), Also in the data for each employee is a status field showing Active or exit reason: Active, Completed, Withdrawn or Cancelled.

 

I want to calculate new starters each month for a seperate graph automatically by the following:  newstarters = (current month count of active EmployeeID  - previous months count of active EmployeeID) + count of Employee ID filtered by exit status: (Completed, withdrawn and Cancelled) to then show this count in a seperate visual. 

 

I've tried using Previousmonth but can't seem to get the right DAX expression - most of the articles i have serached are to sum up totals not count. 

 

heres MY dax attempt: 

NewStarters = CALCULATE(COUNT(FILTER(GTO[Candidate ID] ="Active"))) - CALCULATE(COUNT(FILTER(GTO[Candidate ID] ="Active"))),PREVIOUSMONTH(DATESMTD('Calendar'[Date]))) + COUNTAX(GTO,FILTER(GTO,GTO[New Status] <> "Active"))

 

any help would be appreciated. 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

hi Amitchandak - Your code didn't quite work but got me on the right path to get it working thankyou - actual measure: 

NewStarters = (COUNTROWS(FILTER(GTO,GTO[New Status] = "Active"))
- CALCULATE(COUNTROWS(FILTER((GTO),GTO[New Status] = "Active")),PREVIOUSMONTH('Calendar'[Date])))
+ COUNTROWS(FILTER(GTO,GTO[New Status] <> "Active"))

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

When you say "previous months count of active EmployeeID" - that would mean all the previous months cumulative sum?

 

Can you share more details on the tables structures?

 

Does the Fact table Fact_GTO store the count of candidate or each CandidateID?

In which table you are storing the Active/Exit Reason for each Candidate? How are these linked?

Where is the Start Date?

 

amitchandak
Super User
Super User

@Anonymous , Try like

 

NewStarters = CALCULATE(COUNTrows(FILTER(GTO[Candidate ID] ="Active"))) - CALCULATE(COUNTrows(FILTER(GTO[Candidate ID] ="Active")),PREVIOUSMONTH('Calendar'[Date])) + COUNTAX(GTO,FILTER(GTO,GTO[New Status] <> "Active"))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

hi Amitchandak - Your code didn't quite work but got me on the right path to get it working thankyou - actual measure: 

NewStarters = (COUNTROWS(FILTER(GTO,GTO[New Status] = "Active"))
- CALCULATE(COUNTROWS(FILTER((GTO),GTO[New Status] = "Active")),PREVIOUSMONTH('Calendar'[Date])))
+ COUNTROWS(FILTER(GTO,GTO[New Status] <> "Active"))

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.