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
bradleymac11
New Member

Return next milestone based on today date

Hi all,

 

I have tried to search for other solutions which would solve my question but havnt seemed to be able to find the right one and currently feel out of depth

My data is currently structured:

Project:Stage:Date:
NSWPlan1/05/2019
NSWExecute 1/01/2020
NSWclose1/01/2021
VicPlan1/05/2017
VicExecute 1/01/2018
VICclose

1/01/2019

 

For reporting, per project we were wishing to identify the current stage based on todays date, as well as the next stage to occur. Was unsure to takle this by measure or column.

Where no stage was to come after todays date was wishing to return the last stage.
Any help would be appreciated

1 REPLY 1
harshnathani
Community Champion
Community Champion

Hi @bradleymac11 ,

 

 

You can create 2 measures

 

Next Stage =

var _a = MAX('Table'[Date])
var _NextDate = CALCULATE(MIN('Table'[Date]), FILTER(ALLEXCEPT('Table','Table'[Project]), 'Table'[Date] > _a))
RETURN
//_NextDate
CALCULATE(MAX('Table'[Stage]), FILTER(ALLEXCEPT('Table','Table'[Project]), 'Table'[Date] = _NextDate))
 
 
 
 
 
Current Stage =

var _today = Today()

var _a = MAX('Table'[Date])
var _NextDate = CALCULATE(MIN('Table'[Date]), FILTER(ALLEXCEPT('Table','Table'[Project]), 'Table'[Date] > _a))

RETURN

//_NextDate

IF(DATEDIFF (_NextDate,_today,DAY) < 0 && DATEDIFF (MAX('Table'[Date]),_today,DAY) > 0, "Current State")
 
 
1.jpg
 
 

Regards,
Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

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.