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

using a start and end date to determine active status at yearly milestones

I have a dataset for students with Course name, Start date, End date and current status fields.   looking back over the last 5 years start dates I want to display if the student was or is still active at their 1,2 & 3 year marks.

 

I have a Measure which is very close to showing what I wanted (below), however when validating I realised its applying the current status retrospectively for older dates. i need it to show a student who started Jan 2020 and withdrew Feb 2021 as active at the one year actual but not in the two or three year milestones. the measure below doesnt count correctly in this example. 

 

(I have three measures like this one below, changing the -1 value to match the year)

 

1 year active =
CALCULATE (
    DISTINCTCOUNT ( registrations[StudentID] ),
    DATEADD ( _DIM_Calendar[Date], -1, YEAR ),
    OR (
        registrations[status] = "Completed",
        registrations[status] = "In Progress"
    )
)

 

I can’t quite get my head around how to use the start and end date to calculate if a student was still active after 1 year, 2 years and 3 years - any guidance would be appreciated.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Replying if someone is searching for a similar problem.
I found a work around using power query - i created a count of years column between start and end dates and rounded down.  Then i added in a filter to the above to include if the years qualified.   not very elegant but gets the job done. 

Dax measure Looks like this: 

12m Actual =
CALCULATE (
DISTINCTCOUNT ( registrations2[tyims_trainingcontractid] ),
SAMEPERIODLASTYEAR ( _DIM_Calendar[Date] ),
OR (
registrations2[status Group] = "Completed",
registrations2[status Group] = "In Progress"
),
OR(OR(
registrations2[Years] >= 1,
registrations2[status Group] = "In Progress"),
registrations2[status Group] = "Completed"
))



View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Replying if someone is searching for a similar problem.
I found a work around using power query - i created a count of years column between start and end dates and rounded down.  Then i added in a filter to the above to include if the years qualified.   not very elegant but gets the job done. 

Dax measure Looks like this: 

12m Actual =
CALCULATE (
DISTINCTCOUNT ( registrations2[tyims_trainingcontractid] ),
SAMEPERIODLASTYEAR ( _DIM_Calendar[Date] ),
OR (
registrations2[status Group] = "Completed",
registrations2[status Group] = "In Progress"
),
OR(OR(
registrations2[Years] >= 1,
registrations2[status Group] = "In Progress"),
registrations2[status Group] = "Completed"
))



amitchandak
Super User
Super User

@Anonymous , Check if this blog on a similar topic can help

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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

Helpful resources

Announcements
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.