Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. 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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
146 | |
85 | |
66 | |
52 | |
47 |
User | Count |
---|---|
215 | |
90 | |
83 | |
66 | |
58 |