Forum Discussion
Need Help Writing a Dated Difference Formula
update to the advanced editor, still recieving the errors.
Could you check on this?
n = [Submittal ID],
t = Table.SelectRows(#"Changed Type", each [Submittal ID] = n),
n references [Submittal ID] and [Submittal ID] references n.
- KarlConstruct6 years agoFrequent Visitor
I made both of the chanages mentioned above. This is what I have currently, with the following errors. Please see the photos below.
- v-lid-msft6 years agoCommunity Support
Hi KarlConstruct ,
Sorry for our mistake, please try to use the follwing sub query, also very appreciate danextian can point the error.
Test = Table.SelectRows( #"Changed Type2", each let d = [Sent Date], n = [Submittal ID], t = Table.SelectRows(#"Changed Type2", each [Submittal ID]=n), isMin = List.Contains(Table.ToList(Table.TransformColumnTypes(Table.SelectColumns(Record.ToTable(Table.Min(Table.SelectColumns(t,"Sent Date"),"Sent Date")),"Value"),{{"Value",type text}})),Date.ToText(d)), isMax = List.Contains(Table.ToList(Table.TransformColumnTypes(Table.SelectColumns(Record.ToTable(Table.Max(Table.SelectColumns(t,"Sent Date"),"Sent Date")),"Value"),{{"Value",type text}})),Date.ToText(d)) in isMin or isMax )We do not need to change the type of Submittal ID column, the Value is the column name of record.
All the queries are here:
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Zc65DcAgEADBXi4G6R7eWhD9t2HLThCbTjRriUkSV5tZLavLThcFqZAqqX3kJ3XSIE2QKclI/z5OClIhVVIjddK73w8=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [#"Submittal ID" = _t, #"Sent Date" = _t]), #"Changed Type2" = Table.TransformColumnTypes(Source,{{"Submittal ID", type number}, {"Sent Date", type date}}), Test = Table.SelectRows( #"Changed Type2", each let d = [Sent Date], n = [Submittal ID], t = Table.SelectRows(#"Changed Type2", each [Submittal ID]=n), isMin = List.Contains(Table.ToList(Table.TransformColumnTypes(Table.SelectColumns(Record.ToTable(Table.Min(Table.SelectColumns(t,"Sent Date"),"Sent Date")),"Value"),{{"Value",type text}})),Date.ToText(d)), isMax = List.Contains(Table.ToList(Table.TransformColumnTypes(Table.SelectColumns(Record.ToTable(Table.Max(Table.SelectColumns(t,"Sent Date"),"Sent Date")),"Value"),{{"Value",type text}})),Date.ToText(d)) in isMin or isMax ) in Test
Best regards,- KarlConstruct6 years agoFrequent Visitor
I still seem to be getting the same errors as before unfortunately.
I have created a pbix file with all of my code in the advance editor, if you could please take a look. I would really appreciate it.