Forum Discussion
KarlConstruct
6 years agoFrequent Visitor
Need Help Writing a Dated Difference Formula
I have a txt file brought into PowerBI via a sharepoint folder, and its a list of transmitted documents and the dates in which each transmission happened. I don't necessarily care about all of the c...
v-lid-msft
6 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,
KarlConstruct
6 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.