Forum Discussion
Query editor filter the latest date
- 9 years ago
You can Group By plant with operation "All Rows" and then adjust the generated code to have the maximum date selected.
let Source = Table1, #"Grouped Rows" = Table.Group(Source, {"Plant"}, {{"AllData", each Table.Max(_,"Date"), type record}}), #"Expanded AllData" = Table.ExpandRecordColumn(#"Grouped Rows", "AllData", {"FileName", "Date"}, {"FileName", "Date"}) in #"Expanded AllData"
Well, if you use DAX code in the query editor, it isn't going to work.
This would be Power Query code:
let
Content = Table.FromColumns({{"F02_Shipping_19062017","F02_Shipping_19062018","F03_Shipping_19062017"}},type table[Name = text]),
#"Split Column by Delimiter" = Table.SplitColumn(Content, "Name", Splitter.SplitTextByDelimiter("_", QuoteStyle.Csv), {"Name.1", "Name.2", "Name.3"}),
#"Changed Type" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Name.1", type text}, {"Name.2", type text}, {"Name.3", Int64.Type}})
in
#"Changed Type"
And this is how the last 2 steps were created:
what is file name?
Because i got null value?
- MarcelBeug9 years agoCommunity Champion
So now you are asking me where you can find the filenames?
That feels like the world upside-down.
It is your data, so you should know where the filename is located.
Otherwise please share a screenshot that shows your column with filenames.
Are you sure you selected this column before splitting by underscore (_)?
Or did you just copy and paste my code somewhere into your query?
That ain't gonna work, that's why I created a video to illustrate the step to take.
- melina9 years agoHelper IV
Ok, i got the solution..!
Sorry and thanks!:smileyhappy: