powerquery

PowerQuery use a cell values in a URL

时光总嘲笑我的痴心妄想 提交于 2019-12-11 14:46:43
问题 I have the following PowerQuery code. Which collects some data from MSFT in yahoo finance. I have a cell A1 for example which I would like to put MSFT , GOOG or another symbol. How can I change it so that when I change A1 it will automatically redownload for the new symbol? let Quelle = Web.Page(Web.Contents("https://finance.yahoo.com/q/bs?s=MSFT+Balance+Sheet&annual")), Data = Quelle{1}[Data], FirstRowHeader = Table.PromoteHeaders(Data) in FirstRowHeader Using; $A$1 did not work. https:/

Power Query - Add Column CountIF across two tables ie =COUNTIF(People[CityId],[@Id])

烂漫一生 提交于 2019-12-11 14:24:16
问题 I have two tables in PowerQuery City and People . CITY Id, Name 1, Brisbane 2, Sydney 3, Melbourne PEOPLE Id, Name, CityId 1, Jay, 1 2, Sam, 2 3, Paul, 1 4, Sarah, 3 I'd like to add a column to City that shows a count of how many people belong to that city. So far I have: Table.AddColumn(City, "People.Count", each Table.RowCount( Table.SelectRows( People, each [CityId] = [Id] ) ) ) This returns all zeros in the new column. If I replace [Id] with 1 then I get 2 . It appears the [] references

Looping for slicer selection working on regular pivots, but not working on power pivots

旧时模样 提交于 2019-12-11 14:09:14
问题 All - this is in RE: Excel VBA. I am looking for looping through slicer selection and print PDF's. my code does work for standard pivots, but it does not work when using it on PowerPivot which is what I am looking for. Can anyone please shed some light on how to turn the below so it works in powerpivot? (slicer from power pivot source data) Option Explicit Sub ExportPDFs() Dim sI As SlicerItem, sI2 As SlicerItem, sc As SlicerCache Dim fname$ Set sc = ActiveWorkbook.SlicerCaches("Slicer_Date")

Power Query - Transpose unique values and get matching values in rows

时光怂恿深爱的人放手 提交于 2019-12-11 13:44:53
问题 I am trying to transform a very simple input_table into this output_table: I am basically trying to: Get unique items in first column Transpose and promote these items as column headers Get matching values (from the second column in input_table ) under each unique header I am using Power Query because I need the output_table to dynamically update each time I add records to input_table , but any other dynamical solution is accepted (Array Formulas, intermediate Tables, etc...). No VBA. 回答1:

power query subtract row above from row below

好久不见. 提交于 2019-12-11 13:39:09
问题 I am using power query in excel and i used create custom column to create a new column, what i desperately need is for this new column to take the value from the second row and subtract it from the first row , and again this will need to happen for all rows like so: row two is subtracted from row one, and row three will be subtracted from row two and row four will be subtracted from row three. PLEASE help. I have no understanding of dax nor power query started using it today and i only need

How to filter rows in a table based on values in another table in power query

爷,独闯天下 提交于 2019-12-11 12:33:29
问题 I have two tables in power query. Price table Date Company Price 01/01/2000 A 10 01/02/2000 A 12 01/03/2000 A 15 01/01/2000 B 15 01/02/2000 B 85 01/03/2000 B 98 Size table Date Company Size 01/06/2000 A 10 01/06/2001 A 12 01/06/2002 A 15 01/06/2000 B 15 01/06/2001 B 85 01/06/2002 B 98 In Price table, I want only to have companies which are in size table. In other words, If company C is not in the size table, I do not need that company data points in the price table. Here no need to consider

Power query & power pivot - empty table and clearing pivot

核能气质少年 提交于 2019-12-11 10:24:45
问题 Hope you could help. I have the below code in my power query and it is working great with a connected power pivot table. As soon as the Source line is returning "This table is empty" it all goes wrong: Power query return error message that the 2 lines following the source line, are not recognized. The table in the power pivot is showing the last results from the last working query. I need the table to be empty if there are no results. How do i do that? let UrlSource = Excel.CurrentWorkbook(){

SQL - Julien Date (CYYDDD) to date

陌路散爱 提交于 2019-12-11 09:54:08
问题 Unfortunately, this is my first approach with SQL! I am creating with the following code a query between an oracle DB and Excel (Power Query). select "$Table"."Order" as "Order", "$Table"."NR" as "Nr", "$Table"."JDDATE" as "JDDATE" from "POOLDB2"."3112" "$Table" WHERE "Key" >118001 AND "CodeAA" = 1 This code works! Now I want to format the Julian Date (CYYDDD) - for example 118001 for the 01.01.2019 - to a normal date format. Does anyone know, how to implement this into the code above? Maybe

How can I save a path criteria when I import from folders?

江枫思渺然 提交于 2019-12-11 08:59:37
问题 I import many textfiles from a folder with subfolders, everything works fine so far. My folder has the same text file in many folders for different Periods, so e.g.: AllData\201501\Revenues.txt AllData\201502\Revenues.txt AllData\201502\Revenues.txt ..... I need a Part from the path like "201501" inside my query which is preparing the Revenues. I can't write the date into the .txt file, is generated from third party. How can I join the FullPath on my text file rows? Cutting it after that is

Values hard-coded after power query runs is dislocated when data source updates in Excel

大憨熊 提交于 2019-12-11 08:54:01
问题 I have a table called "COMPANIES" like this: Company Type Lafarge Cement Google IT Disney Entertainment The table is then loaded into Power Query and displayed as table COMPANIES2 In table COMPANIES2 in Excel view , I have added a new column with hard-coded text like this: Company Type Country Lafarge Cement France Google IT US Disney Entertainment US Now back at table COMPANIES, a new row is added: Company Type Lafarge Cement Toyota Cars Google IT Disney Entertainment When I refresh table