Forum Discussion
Finding the highest Date in a record
- 8 years ago
How abou this calculated column
= DATEDIFF ( MAXX ( FILTER ( UNION ( ROW ( "MyDates", CALCULATE ( VALUES ( Table1[Sold Date] ) ) ), ROW ( "MyDates", CALCULATE ( VALUES ( Table1[Advised Date] ) ) ), ROW ( "MyDates", CALCULATE ( VALUES ( Table1[Quoted date] ) ) ) ), [MyDates] <= Table1[Activation Date] ), [MyDates] ), Table1[Activation Date], DAY )
How abou this calculated column
=
DATEDIFF (
MAXX (
FILTER (
UNION (
ROW ( "MyDates", CALCULATE ( VALUES ( Table1[Sold Date] ) ) ),
ROW ( "MyDates", CALCULATE ( VALUES ( Table1[Advised Date] ) ) ),
ROW ( "MyDates", CALCULATE ( VALUES ( Table1[Quoted date] ) ) )
),
[MyDates] <= Table1[Activation Date]
),
[MyDates]
),
Table1[Activation Date],
DAY
)Thank you very much, this worked great for computing the proper number of days. How would a column or measure be changed to record this new date as a displayable field? I tried to reverse engineer the formula to give me the findings of the 'MyDates' but to no avail.
Scott
- Zubair_Muhammad8 years ago
Community Champion
- sdaniels8 years agoRegular Visitor
The formula you supplied worked great for computing the number of days. But now the team is asking for to display which date was used to show the start date, along side the new # of days. So I was wondering if its easy to tweak the new formula to not only show the number of days, but also the date it was determining was the highest of the 3.
Thank you - Scott
- pxg086808 years ago
Resolver III
From Zubair_Muhammad post
try doing this to get max date of the first three columns.
MAXX (
FILTER ( UNION ( ROW ( "MyDates", CALCULATE ( VALUES ( Table1[Sold Date] ) ) ),
ROW ( "MyDates", CALCULATE ( VALUES ( Table1[Advised Date] ) ) ),
ROW ( "MyDates", CALCULATE ( VALUES ( Table1[Quoted date] ) ) )
),
[MyDates] <= Table1[Activation Date]
),
[MyDates]
)