Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
100 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |