Forum Discussion
RonaldvdH
2 years agoPost Patron
Sorting Summarized table
Hey Guys, I've got a summarized table based on unique streetnames and then a couple of date columns (begin and end) Those date columns are based on another table using MINX and MAXX I want to s...
lbendlin
2 years agoSuper User
yes the query will appear as a new table in Power BI, and you can add its columns to a visual as needed.
RonaldvdH
2 years agoPost Patron
lbendlin yes and no because it does appear as a table but it's not linked to the right source. It's linked to your testfile i'm guessing.
The table in my rapport it has to link with is the table Straten, so how do I do that ?
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCi4pSk0tUXBU0lEyMNQ1sNQ1MgYxLaDMWB1UJUYIJWaYSpxA4qZwJYZG2JUYIkwxwmKRM0iJCcIULBaBlBgYI9xigqnEBVkcyVloSgwRnjbE4hZXoLgCGMfGAgA=", BinaryEncoding.Base64),
Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Street = _t, Begin = _t, End = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Adres straat", type text}, {"Begin", type date}, {"Eind", type date}},"nl"),
#"Grouped Rows" = Table.Group(#"Changed Type", {"Adres straat"}, {{"Begin", each List.Min([Begin]), type nullable text}, {"Eind", each List.Max([End]), type nullable text}}),
#"Sorted Rows" = Table.Sort(#"Grouped Rows",{{"Begin", Order.Ascending}, {"Eind", Order.Ascending}, {"Adres straat", Order.Ascending}}),
#"Added Index" = Table.AddIndexColumn(#"Sorted Rows", "SortOrder", 1, 1, Int64.Type)
in
#"Added Index"
I've changed the column names to the exact column names in my rapport but the source has to be altered to my table Straten