Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
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
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
98 | |
61 | |
47 | |
36 | |
34 |