Forum Discussion
remaining column to return previous payment amount
- 3 years ago
Hi RSSILVA_22
if you're looking for a calculated column then please try
Previous Payment =
VAR CurrentDate = 'Table'[payment date]
VAR CurrentTable =
CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[cod_client] ) )
VAR TableBefore =
FILTER ( CurrentTable, 'Table'[payment date] < CurrentDate )
VAR PreviousRecord =
TOPN ( 1, TableBefore, 'Table'[payment date] )
RETURN
MAXX ( PreviousRecord, 'Table'[value] )
Hi RSSILVA_22
if you're looking for a calculated column then please try
Previous Payment =
VAR CurrentDate = 'Table'[payment date]
VAR CurrentTable =
CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[cod_client] ) )
VAR TableBefore =
FILTER ( CurrentTable, 'Table'[payment date] < CurrentDate )
VAR PreviousRecord =
TOPN ( 1, TableBefore, 'Table'[payment date] )
RETURN
MAXX ( PreviousRecord, 'Table'[value] )
- RSSILVA_223 years ago
Helper I
very good
thanks.