Anonymous
5 years agoNot applicable
Status:
New
#time converting from function to reference in Dataflow
Using the function #time() in a dataflow seems to result in the mashup engine 'correcting' it to #"#time"() This seems like it is potentially a new issue, as Dataflows using this function d...
Anonymous
5 years agoNot applicable
Hi v-lili6-msft
The following query in a DataFlow should replicate the error:
let
Source = Table.FromRecords({
[Time = "01/01/2020 08:00:30"],
[Time = "01/02/2020 18:30:15"]
}),
#"Changed column type" = Table.TransformColumnTypes(Source, {{"Time", type datetime}}),
#"Added custom" = Table.AddColumn(#"Changed column type", "TestTime1", each #time(18, 22, 15), type time),
#"Added custom 1" = Table.AddColumn(#"Added custom", "TestTime2", each #time(Time.Hour([Time]), Time.Minute([Time]), 0), type time),
#"Added custom 2" = Table.AddColumn(#"Added custom 1", "TestDate1", each #date(2020,1,1), type date),
#"Added custom 3" = Table.AddColumn(#"Added custom 2", "TestDate2", each #date(Date.Year([Time]), Date.Month([Time]), 1), type date)
in
#"Added custom 3"
What you'll see from this, is once the query is applied, all the # functions get the additional tags around them, ie #date() becomes #"#date"().
The following syntax will resolve the issue:
let
Source = Table.FromRecords({
[Time = "01/01/2020 08:00:30"],
[Time = "01/02/2020 18:30:15"]
}),
#"Changed column type" = Table.TransformColumnTypes(Source, {{"Time", type datetime}}),
#"Added custom" = Table.AddColumn(#"Changed column type", "TestTime1", each #time(18, 22, 15) as time, type time),
#"Added custom 1" = Table.AddColumn(#"Added custom", "TestTime2", each #time(Time.Hour([Time]), Time.Minute([Time]), 0) as time, type time),
#"Added custom 2" = Table.AddColumn(#"Added custom 1", "TestDate1", each #date(2020,1,1) as date, type date),
#"Added custom 3" = Table.AddColumn(#"Added custom 2", "TestDate2", each #date(Date.Year([Time]), Date.Month([Time]), 1) as date, type date)
in
#"Added custom 3"
Anonymous Glad it could help. I've found a few more of our dataflows are affected this morning which implies it is a new issue.