I have PQ query set up in Excel desktop. The last step is changing the type of the Date column from text to datetime. This works fine in the desktop version. When I refresh in Excel for the Web, the date column ends up blank. I have tried so many workarounds and cannot get anything to work. I need the query to be able to refresh from the web version because many of the users only have access to the web version. Any thoughts?
If I leave it as text, then once the table is inserted into excel, it is converted into a number.
let
Source = Excel.CurrentWorkbook(),
#"Filtered Rows" = Table.SelectRows(Source, each ([Name] <> "CleanedTable")),
NICU16 = #"Filtered Rows"{[Name="NICU16"]}[Content],
#"Replaced Value" = Table.ReplaceValue(NICU16,null,0,Replacer.ReplaceValue,{"Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7", "Column8", "Column9", "Column10", "Column11", "Column12", "Column13", "Column14", "Column15", "Column16"}),
#"Removed Top Rows" = Table.Skip(#"Replaced Value",1),
#"Promoted Headers" = Table.PromoteHeaders(#"Removed Top Rows", [PromoteAllScalars=true]),
#"Renamed Columns" = Table.RenameColumns(#"Promoted Headers",{{"NICU", "Metric"}}),
#"Removed Columns" = Table.RemoveColumns(#"Renamed Columns",{"Totals"}),
#"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Removed Columns", {"Metric"}, "Attribute", "Value"),
#"Renamed Columns1" = Table.RenameColumns(#"Unpivoted Columns",{{"Attribute", "Date"}}),
#"Pivoted Column" = Table.Pivot(#"Renamed Columns1", List.Distinct(#"Renamed Columns1"[Metric]), "Metric", "Value"),
#"Replaced Errors" = Table.ReplaceErrorValues(#"Pivoted Column", {{"PI-productivity index", 0}}),
#"Changed Type" = Table.TransformColumnTypes(#"Replaced Errors",{{"Date", type datetime}})
in
#"Changed Type"