Forum Discussion
calculated column help
I have the following table below:
the field "cod client" is repeated several times in the table.
I need a column that shows the largest date, before the current record.
example: "cod de cliente" AAAAAAA tem o Ășltimo registro com a data 2022-04-11. The next column should show the date 2022-03-05. In this record (2022-03-05) must be the largest datan before it. if there is no previous record show empty.
If anyone can help, I'd be grateful.
https://drive.google.com/file/d/1HRYhWWKty2YUXNPYnYb_YPZlFbx8sMa7/view?usp=sharing
Hi RSSILVA_22
Here is the sample file withe workable solution https://www.dropbox.com/t/KT0CShGmy8yTXvEcPrevious Date = VAR CurrentDate = pratic[date_value] VAR CurrentClientTable = CALCULATETABLE ( pratic, ALLEXCEPT ( pratic, pratic[cod_client] ) ) RETURN MAXX ( FILTER ( CurrentClientTable, pratic[date_value] < CurrentDate ), pratic[date_value] )
6 Replies
- tamerj1Community Champion
Hi RSSILVA_22
you can try
Previous Date = VAR CurrentDate = Table1[date_value] VAR CurrentClientTable = CALCULATETABLE ( Table1, ALLEXCEPT ( Table1, Table1[code_client] ) ) RETURN MAXX ( FILTER ( Table1, Table1[date_value] < CurrentDate ), Table1[CurrentDate] )- RSSILVA_22Helper I
did not work. He made the date -1 The expected was to bring the date of the previous registration.
- tamerj1Community Champion
Hi RSSILVA_22
Here is the sample file withe workable solution https://www.dropbox.com/t/KT0CShGmy8yTXvEcPrevious Date = VAR CurrentDate = pratic[date_value] VAR CurrentClientTable = CALCULATETABLE ( pratic, ALLEXCEPT ( pratic, pratic[cod_client] ) ) RETURN MAXX ( FILTER ( CurrentClientTable, pratic[date_value] < CurrentDate ), pratic[date_value] )