Forum Discussion
Richard_Clipsto
1 year agoFrequent Visitor
Help with a Calculated Column
Hi, I have a table which looks a bit like this: Unit Amendment Type Final Rent Start Date End Date A Original Lease £100 01/01/2020 31/12/2023 A Termination 31/12/2023...
- 1 year ago
Hi Richard_Clipsto , Please try the following Dax code to create the calculated column:
PreviousFinalRent = VAR CurrentUnit = Table[Unit] VAR CurrentStartDate = Table[Start Date] RETURN CALCULATE( MAX(Table[Final Rent]), FILTER( Table, Table[Unit] = CurrentUnit && Table[Amendment Type] IN {"Original Lease", "Renewal"} && Table[Start Date] < CurrentStartDate ) )
Bibiano_Geraldo
1 year agoSuper User
Hi Richard_Clipsto , Please try the following Dax code to create the calculated column:
PreviousFinalRent =
VAR CurrentUnit = Table[Unit]
VAR CurrentStartDate = Table[Start Date]
RETURN
CALCULATE(
MAX(Table[Final Rent]),
FILTER(
Table,
Table[Unit] = CurrentUnit &&
Table[Amendment Type] IN {"Original Lease", "Renewal"} &&
Table[Start Date] < CurrentStartDate
)
)- Richard_Clipsto1 year agoFrequent Visitor
This is great thank you