Forum Discussion
themitchells16
Mar 16, 2017Copper Contributor
Makine a table from a bunch of Data
Hello Community. I have a quick question to ask the community. I have a data set (attached below) I'm trying to answer a few questions. i need to find a way to make a table that counts the number of ...
SergeiBaklan
Mar 16, 2017Diamond Contributor
Hi,
Perhaps easiest way is to use Get&Transform.
If i understood your logic correctly. Name your first column as ID (in A1), when generate the query on your data (stay on any cell within it, when Data->From table),
edit the query and change the code on
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
// Add Column with the event from next row
AddEventFromNextRow = Table.AddColumn(Source,
"Custom", each Source[event_desc_id]{[ID]+1}
),
FilterEvents = Table.SelectRows(AddEventFromNextRow,
each ([event_desc_id] = "O") and (
[Custom] = "2FGA" or
[Custom] = "3FGM"
)
),
GroupByTeamPlayer = Table.Group(FilterEvents,
{"team_name", "player_name"},
{{"Count", each Table.RowCount(_), type number}}
)
in
GroupByTeamPlayerassuming the name of the table is Table1 (not all filetrs are in the query above, you may add) . Load the query into the new table.