powerquery

Yahoo finance historical stock price power query returns 301 response

╄→尐↘猪︶ㄣ 提交于 2019-12-12 19:05:45
问题 Until today my Excel 2016 power query was able to obtain historical stock pricing data from the following URL https://finance.yahoo.com/quote/AAL/history?p=AAL. The Credential type was anonymous and the privacy level was public. I also tried using my username and password for my yahoo account in the Web Credential window with no luck. Excel returns a message that contains a 301 response. Power query does work with Google Finance but the URL https://www.google.com/finance/historical?q=NASDAQ

Add missing date rows in Power BI/Power Query and take value of row above

坚强是说给别人听的谎言 提交于 2019-12-12 08:16:48
问题 Say I am importing something like the following into PowerBI: Date | Quantity |---------------------|------------------| | 1/1/2018 | 22 | | 1/3/2018 | 30 | | 1/4/2018 | 10 | |---------------------|------------------| Where the external source table is a series of date, value rows with some date values missing. I'd like to execute some DAX/M to add any missing date rows into the data set, where 'Quantity' value is taken from the first date prior. So my resulting dataset would like like this:

Why does a reference to a value in previous row throw this Expression.Error?

为君一笑 提交于 2019-12-12 06:47:28
问题 I am trying to perform an operation in Excel using Powerquery. I want to remove contacts in a list if they are connected to a certain CompanyID but are listed with a different CompanyName. The fist step is to filter them out by comparing to the row above. They are always listed consecutively. Next step is to remove all rows containing the value delete in the delete column but unfortunately I do not get to that step. I have looked at this post and have tried with the following code: = Table

Arranging Data in a Query Table

喜欢而已 提交于 2019-12-12 01:49:14
问题 I'm trying to figure out a simple way (using PowerQuery) to convert this: into this: I've spent days trying to figure out a simple way to do it. Everything I've tried has failed. 回答1: You can use Group By on the Transform tab, group by project and define a aggregation for each of the segment columns (e.g. Sum). Then adjust the created code from List.Sum to List.RemoveNulls. Then add a column with nested tables from the segment columns, using Table.FromColumns. Remove the original segment

Use values in cells as parameters in stored procedure in power query editor

偶尔善良 提交于 2019-12-11 23:21:46
问题 I'm building an excel sheet that will show sales for date range. I want the user to be able to write/select the dates in a cell instead of having to edit the query in the power query editor. Here is the setup: I've made a test stored procedure for this post to demonstrate what I mean. Here is the Query in the power query editor The loaded data from the stored procedure is in the green table and the potential parameters are in the D and E columns. Thanks 回答1: Make the cells you want to load

How to transpose multiple .csv files and combine in Excel power query?

删除回忆录丶 提交于 2019-12-11 19:13:45
问题 I want to analyse some spectral data. I have a ~6500 csv files . Each .csv file contains data with the fromat shown in pics. How can I transpose all csv files?? ....so then....I can combine them in powerQuery?? Thank you! 回答1: This will read in all .csv files in a directory, transpose and combine them for you Use Home...advanced editor... to paste into PowerQuery and edit the 2nd line with the appropriate directory path Based on Alexis Olson recent answer Reading the first n rows of a csv

How can I bring a record from another table with certain conditions from my table in DAX?

和自甴很熟 提交于 2019-12-11 18:39:34
问题 I have two tables. One with dates and customer ID's of tech support given [Table 1], and the other one with surveys sent to the customers [Table 2]). The problem is that the surveys are sent some days after the service is done. So, I need to find the survey ID with the closest date from the survey table and bring it to my tech support table. Here's a sample of my data and the result wanted. Table1: TechSupportDate CustomerID 01/12/2018 1 02/12/2018 2 05/12/2018 1 Table2: SurveyID SurveyDate

Parameterise SQL Stored Procedure Excel Get&Transform

Deadly 提交于 2019-12-11 17:23:52
问题 I'm trying to call a stored select procedure from SQL Server into Excel. In SSMS could be written as @val1=1; @val2=2; Execute SP_DoStuff(@param1=@val1,@param2=@val2); Looking at similar questions, a common answer is to concatenate the parameter and run as dynamic SQL. For example: Use values in cells as parameters in stored procedure in power query editor The answer there is Source = Sql.Database("xxxxxxxxxxxxxxxxx", "xxxxxxxxxxx", [Query= "#(lf)#(lf)EXEC#(tab) [dbo].[TestParameter]#(lf) #

Add a running total to a PowerQuery result

邮差的信 提交于 2019-12-11 16:42:54
问题 I am trying to create a count of dates that occur during particular weeks (the last five weeks including this week) and a total running count for dates which would include records prior to the listed five week duration. I could do this fairly easily using standard Excel formula, but I'm trying to learn PowerQuery and the M language. My first query returns the relevant rows from the original source data (another query that pulls everything from the Excel table and forces the correct data type

Expression.Error: The name 'Text.BeforeDelimiter' wasn't recognized. Excel 2016

两盒软妹~` 提交于 2019-12-11 16:05:04
问题 I have an excel "Add Column" from Power Query editor. My data looks like this, 26567-5698 51254-5458 6954-1545 45415 56541 5621 .. Some have 4 digits before - and some have 5 digits before - . For those values that have - in between, I like to extract the first part (before delimiter). I tried the following, if Text.Length(Text.BeforeDelimiter([MyCol], "-")) = 4 then "0" & Text.Start([MyCol],4) else if Text.Length(Text.BeforeDelimiter([MyCol], "-")) = 5 then Text.Start([MyCol],5) else [MyCol]