RE: My Power Query search engine17 Jan 2026 11:10
Talking to others definitely concentrates the mind, explaining a problem to someone makes you think logically and can solve the problem without them responding? I remembered using AI for my complicated solution that was lost.
And I clearly asked a simpler question and got this - from which I have a working solution.
AI response was ..
To get a date in Power Query M without the time component, you can use the function DateTime.Date(yourDateTimeValue), which extracts just the date part from a datetime value. Alternatively, you can convert a datetime to a date using Date.From(yourDateTimeValue).
Needed two steps .... so close but so far with my original coding. Debugging is almost non-existent Dates are integers, DateTime are number with a decimal point followed by a fraction of a day, so .5 is noon or 12 hours (half of 24!).
let
CurrentDate = Date.From(DateTime.LocalNow()),
FormattedDate = Date.ToText(CurrentDate,"dd MMM yyyy"),
Query1 = ({1..2}),
#"Converted to Table" = Table.FromList(Query1, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Changed Type" = Table.TransformColumnTypes(#"Converted to Table",{{"Column1", type text}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Column1", "Pagenum"}}),
Custom1 = #"Renamed Columns",
#"Invoked Custom Function" = Table.AddColumn(Custom1, "PostersOnPage", each PostersOnPage([Pagenum])),
#"Removed Columns" = Table.RemoveColumns(#"Invoked Custom Function",{"Pagenum"}),
#"Expanded PostersOnPage" = Table.ExpandTableColumn(#"Removed Columns", "PostersOnPage", {"Column1", "Column2", "Column3", "Column4"}),
#"Renamed Columns1" = Table.RenameColumns(#"Expanded PostersOnPage",{{"Column1", "Postername"}, {"Column2", "Subject"}, {"Column3", "PostedTime"}, {"Column4", "PostContent"}}),
#"Capitalized" = Table.TransformColumns(#"Renamed Columns1",{{"Postername", Text.Proper, type text}}),
#"Replaced Value" = Table.ReplaceValue(#"Capitalized",each "Today",FormattedDate,Replacer.ReplaceText,{"PostedTime"}),
Custom2 = #"Replaced Value",
#"Converted to Answers" = Table.Combine({#"Custom2"})
in
Custom2