Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
I have a table that looks like the one below. Each entry is a single project.
| Client Name | Project Entry Date | Project Completed Date | Ageing in Days | Project Status |
| Client A | 22/01/2019 | 01/04/2019 | 69 days | Completed |
| Client B | 13/07/2020 | Ongoing | ||
| Client C | 17/06/2021 | 19/092021 | 103 days | Completed |
| Client D | 21/09/2021 | 29/09/2021 | 8 days | Completed |
| Client E | 23/10/2021 | 06/01/2022 | 74 days | Completed |
| CLient F | 27/01/2022 | Ongoing |
So I want to get the number of days of an ongoing project that has stayed the most. That project would probably be the one for Client B since it does not have a completed date and is the earliest.
I am thinking Datediff would work with and then get a value of the highest using RankX , DENSE. I want to display that number of days on a card. Any assistance is highly appreciated.
Solved! Go to Solution.
Oldest project =
VAR __Date = CALCULATE (
MIN ( 'Table'[Entry Date] ),
FILTER (
'table',
'table'[Status] <> "completed"
&& 'table'[Status] <> "removed"
&& 'table'[Status] <> "cancelled"
)
)
RETURN
DATEDIFF( __Date, TODAY(), DAY)
How about this:
Oldest =
VAR __Days =
MAXX (
'Table',
IF (
ISBLANK ( 'Table'[Completed Date] ),
DATEDIFF ( 'Table'[Entry Date], TODAY (), DAY ),
DATEDIFF ( 'Table'[Entry Date], 'Table'[Completed Date], DAY )
)
)
RETURN
__Days
Thanks for this. However, it is somewhat not correct from my side's explanation. I have been able to extract a date with the oldest date of an ongoing project. The formula used is as follows.
Oldest project =
CALCULATE (
MIN ( 'table'[entry_date] ),
FILTER (
'table',
'table'[Status] <> "completed"
&& 'table'[Status] <> "removed"
&& 'table'[Status] <> "cancelled"
)
)
how can I subtract this date from today's Date using Today()? @Adescrit
Oldest project =
VAR __Date = CALCULATE (
MIN ( 'Table'[Entry Date] ),
FILTER (
'table',
'table'[Status] <> "completed"
&& 'table'[Status] <> "removed"
&& 'table'[Status] <> "cancelled"
)
)
RETURN
DATEDIFF( __Date, TODAY(), DAY)
In my answer, it returns a blank. Not sure why. Thanks, though
Finally it works
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 50 | |
| 40 | |
| 37 | |
| 14 | |
| 14 |
| User | Count |
|---|---|
| 85 | |
| 69 | |
| 38 | |
| 29 | |
| 27 |