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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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