Forum Discussion
EDO_01_1789
4 years agoHelper I
Previous date dax or M
Hello yes I would like your help about a probleme I have put below a table of what I want : Fichier Excel Validator Name Validation date Previous validator date Excel File A Valid...
- 4 years ago
Hi, EDO_01_1789 ;
You could create a measure by dax.
Measure = CALCULATE(MAX('Table'[Validation date]), FILTER(ALL('Table'),[Fichier Excel]=MAX('Table'[Fichier Excel])&&[Validation date]<MAX('Table'[Validation date])))the final show:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Vijay_A_Verma
4 years agoMost Valuable Professional
See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test (later on when you use the query on your dataset, you will have to change the source appropriately. If you have columns other than these, then delete Changed type step and do a Changed type for complete table from UI again)
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("jdExCoNAFATQqyxbu/D3765JmwQ9go1YSLQQlgRCihwrZ8jJtBwccNN+XjEzv+9t87nP2bRLns3FVrYb8zKN7+fLPH5f47eLiqqTs/PeDlXBK3ot+4A+lH1EH8s+oU97fz3sK5SfPfYVys8e+wrlZ4995Y/82Ffqvb8d9D05of+yV/S0D/uAnvZhH9HTPuwT+m2fYQU=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Fichier Excel" = _t, #"Validator Name" = _t, #"Validation date" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Fichier Excel", type text}, {"Validator Name", type text}, {"Validation date", type date}}),
#"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 0, 1, Int64.Type),
BuffList = List.Buffer(#"Changed Type"[Validation date]),
#"Added Custom" = Table.AddColumn(#"Added Index", "Previous validator date", each try BuffList{[Index]-1} otherwise null),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Index"})
in
#"Removed Columns"