Forum Discussion
GGG123
2 years agoRegular Visitor
Issue with List.Max ([Date]) in power query
This formula Date.From(List.Max(Table.Column(#"Reordered Columns", [Date]))) - Date.From([Date]) is returning this error Expression. Error: We cannot convert the value #date(202...
- 2 years ago
I finally worked it out. All I did is to go at the beginning of the code and Filtered Out "Undeposited Items" which was mentioned in the error I was getting 'DataFormat.Error: We couldn't parse the input provided as a Date'.
The thing that I couldnt understand is that when looking at the Column Profile, everything showed 0 Error and the count seemed to be all in order.
Thanks for your help anyway!
ManuelBolz
2 years agoResponsive Resident
Hello GGG123 ,
If my post helped you, please give me a 👍kudos and mark this post with Accept as Solution.
Try this solution.
let
#"Reordered Columns" = YOURCODE
LatestDate = List.Max(Table.Column(#"Reordered Columns", "Date")),
AddedDateDifference = Table.AddColumn(Source, "Date Difference", each Duration.Days(LatestDate - [Date]), Int64.Type)
in
AddedDateDifference
Best regards from Germany
Manuel Bolz
🟦Follow me on LinkedIn
🟨How to Get Your Question Answered Quickly
🟩Fabric Community Conference
🟪My Solutions on Github