m

How do I properly use table.group in a PowerQuery query to dynamically summarize different rows and columns?

陌路散爱 提交于 2021-02-19 08:32:33
问题 I created a table in Excel 2016 where I put various names of columns, columns I wanted to summarize, names to set new column names to, etc. Essentially what I wanted to be a parameter table. I then created a function in the Power Query editor and passed the values in the aforementioned table into the function. At first it failed, but I found Power Query column name as parameter which showed me how to pass one of the column names to a parameter. On first glance the group function seemed to

power query merge two tables based on the transaction date between two dates

不羁岁月 提交于 2021-02-15 07:37:54
问题 I'm trying to perform a join between two tables (1 - transaction table and 2 - employee ID and date range) using Power Query where the transaction date is between two dates. Transaction Table +-------+-----------------+--------+ | EmpID | TransactionDate | Amount | +-------+-----------------+--------+ | 123 | 5/5/2019 | 30 | | 345 | 2/23/2019 | 40 | | 456 | 4/3/2018 | 50 | +-------+-----------------+--------+ Employee ID +-------+-----------+-----------+ | EmpID | StartDate | EndDate | +-----

How to pull data from Toggl API with Power Query?

随声附和 提交于 2021-02-11 18:15:49
问题 First timer when it comes to connecting to API. I'm trying to pull data from Toggl using my API token but I can't get credentials working. I tried to replicate the method by Chris Webb (https://blog.crossjoin.co.uk/2014/03/26/working-with-web-services-in-power-query/) but I can't get it working. Here's my M code: let Source = Web.Contents( "https://toggl.com/reports/api/v2/details?workspace_id=xxxxx&client=xxxxxx6&billable=yes&user_agent=xxxxxxx", [ Query=[ #"filter"="", #"orderBy"=""],

How to pull data from Toggl API with Power Query?

送分小仙女□ 提交于 2021-02-11 18:11:00
问题 First timer when it comes to connecting to API. I'm trying to pull data from Toggl using my API token but I can't get credentials working. I tried to replicate the method by Chris Webb (https://blog.crossjoin.co.uk/2014/03/26/working-with-web-services-in-power-query/) but I can't get it working. Here's my M code: let Source = Web.Contents( "https://toggl.com/reports/api/v2/details?workspace_id=xxxxx&client=xxxxxx6&billable=yes&user_agent=xxxxxxx", [ Query=[ #"filter"="", #"orderBy"=""],

How to pull data from Toggl API with Power Query?

和自甴很熟 提交于 2021-02-11 18:10:27
问题 First timer when it comes to connecting to API. I'm trying to pull data from Toggl using my API token but I can't get credentials working. I tried to replicate the method by Chris Webb (https://blog.crossjoin.co.uk/2014/03/26/working-with-web-services-in-power-query/) but I can't get it working. Here's my M code: let Source = Web.Contents( "https://toggl.com/reports/api/v2/details?workspace_id=xxxxx&client=xxxxxx6&billable=yes&user_agent=xxxxxxx", [ Query=[ #"filter"="", #"orderBy"=""],

M power query - rebuild this data combination

你。 提交于 2021-02-05 10:47:25
问题 Getting the error message on the below query in M, I've tried splitting into 2 different queries before the merge step but still getting the 'this does not directly access a data source, please rebuild the data combination' error *let Source = #"Query List from SP", cols = if {"Type"} = "Indicator" then 4 else 5, DataLoad = (path) => let Doc = Csv.Document( Web.Contents( BaseUrl, [Headers =[#"Content-type"="text/csv", #"Authorization"="Basic " & Credential], RelativePath=path ]), [Delimiter="

What is the difference between [column] and Table.Column(Table, “column”) in M/PowerBI/PowerQuery

99封情书 提交于 2021-02-05 08:00:47
问题 Ciao there! I have a problem with a difference between [column] and Table.Column(Table, "column") in M/PowerBI/PowerQuery. Example Table: '#____column 1_______a 2_______b 3_______c Desired Result: '#____column 1_______TEST 2_______TEST 3_______TEST So, I currently have the following code: = Table.ReplaceValue(PrevQueryTable, each Table.Column(PrevQueryTable, "column"), "TEST", Replacer.ReplaceValue, {"column"}) which does not work. Result: '#____column 1_______a 2_______b 3_______c This

Excel Power Query - Sleep or Wait Command to Wait on API Rate Limit

北城以北 提交于 2021-02-04 19:58:51
问题 In Excel Power Query (PQ) 2016, is there such a function that can insert a "SLEEP 15 seconds" before proceeding? Not a pause, but a sleep function. Problem: I wrote a function in PQ to query: https://westus.api.cognitive.microsoft.com/text/analytics/v2.0. That function works fine, as designed. I have a worksheet with 10K tweets that I want to pass to that function. When I do, it gets to ~60 or so complete and I get an ERROR line in PQ. A look at Fiddler says this: message=Rate limit is

Power Query - M Language: Sum with Group By for multiple columns

佐手、 提交于 2021-01-29 16:22:46
问题 I'm looking to write a DataTransform for an imported csv file which performs the following: GroupBy: State Action: Sums all columns The Input data looks like: The output I'm looking for would show a row each State, a column for each date, and the sum for that date. Just using the Table.Group and List.Sum, I'm able to get this for specific dates: = Table.Group(#"Change Dates to Num", {"Province_State"}, {{"4/19/20", each List.Sum([#"4/19/20"]), type number}, {"4/20/20", each List.Sum([#"4/20

Reference a column by a variable

吃可爱长大的小学妹 提交于 2021-01-27 18:31:10
问题 I want to reference a table column by a variable while creating another column but I can't get the syntax: t0 = Table.FromRecords({[a = 1, b = 2]}), c0 = "a", c1 = "b", t1 = Table.AddColumn(t0, "c", each([c0] + [c1])) I get the error the record's field 'c0' was not found . It is understanding c0 as a literal but I want the text value contained in c0 . How to do it? Edit I used this inspired by the accepted answer: t0 = Table.FromRecords({[a = 1, b = 2]}), c0 = "a", c1 = "b", t1 = Table