powerquery

Power Query M loop table / lookup via a self-join

◇◆丶佛笑我妖孽 提交于 2019-12-14 02:40:24
问题 First of all I'm new to power query, so I'm taking the first steps. But I need to try to deliver sometime at work so I can gain some breathing time to learn. I have the following table (example): Orig_Item Alt_Item 5.7 5.10 79.19 79.60 79.60 79.86 10.10 And I need to create a column that will loop the table and display the final Alt_Item . So the result would be the following: Orig_Item Alt_Item Final_Item 5.7 5.10 5.10 79.19 79.60 79.86 79.60 79.86 79.86 10.10 Many thanks 回答1: Actually, this

Add Special Case to Power BI Query (M)

拥有回忆 提交于 2019-12-14 02:13:24
问题 I'm currently using Power BI's query editor to unpivot, transform, join, re-pivot and re-join some data. Illustrating: REF_Capability: ID#| Capability.1 | Capability.2 | Capability.3| 97 | Crawl | Walk | Run | 98 | Crawl | null | null | 99 | Crawl | Walk | null | Table2: Capability | Attribute| Value | Crawl | Vehicle1 | 4 | Walk | Vehicle1 | 3 | Run | Vehicle1 | 2 | Crawl | Vehicle2 | 0 | Walk | Vehicle2 | 1 | Run | Vehilce2 | 1 | Crawl | Vehicle3 | 0 | Walk | Vehicle3 | 5 | Run | Vehicle3 |

Excel Power Query: Using List.MatchAny on a column value

瘦欲@ 提交于 2019-12-13 23:32:10
问题 In Excel Power Query, I have a table. Column A has single numbers. I want to mark those records where the Column A value matches a list. A cutdown version of the problem is: let TableA = Table.FromColumns({{1,2,4}}, {"A"}), ListB = {4,5,6 }, DPart = Table.AddColumn(TableA, "IsInB", List.MatchesAny(ListB, each _ = [A])) in DPart I get an error in the DPart line Expression.Error: We cannot apply field access to the type Number. Details: Value=4 Key=A Apparently, the code is trying to access the

Individual start date per month

和自甴很熟 提交于 2019-12-13 23:04:31
问题 together how do I get it in PowerPivot or as Dax formula out that for my internal / individual months the beginning of the month from 31.120.2018 for January 2019 receive? So, that I get the January in the PowerPivot calendar table already from 31.12.2018 and then in the 4-4-5 weeks cycle? So 31.12.2018 + 28 days = January 31.12.2018 + (28 days * 2) = February 31.12.2018 + (28 days * 2) + 7 days = March Does anyone have an idea? Best Regards 回答1: First I create a calendar table, this is the

How can I expand all lists in a row of lists at the same time?

安稳与你 提交于 2019-12-13 18:20:57
问题 I would like to expand all of the lists in this table at once without having to explicitly name (hard-code) each column . I do want to assume that all columns have a list in the row. I also want to be able to apply the solution to a table with less or more columns than are in the example. The table might decrease or increase its number of columns and the columns' names might change, which is why I don't want to use explicit column names. I've found a few threads about expanding multiple lists

Excel Power Query - How to create final table based on Joins

烈酒焚心 提交于 2019-12-13 03:53:59
问题 Can you please help me in creating a final table using Excel Power Query based on the logic mentioned in below screenshot: 回答1: I resolved it by myself. Following are the steps: 1) I created a unique country code list with 1 column (Origin & Destination) 2) Left join with Origin table and then got the destination code from common table 3) added a custom column to get all rows except where origin = Destination. In this way I got the Outbound column values. 来源: https://stackoverflow.com

extract and replace parameters in SQL query using M-language

穿精又带淫゛_ 提交于 2019-12-13 03:21:26
问题 This question is related with this question. However, in that question I made some wrong assumptions... I have a string that contains a SQL query, with or without one or more parameters, where each parameter has a "&" (ampersand sign) as prefix. Now I want to extract all parameters, load them into a table in excel where the user can enter the values for each parameter. Then I need to use these values as a replacement for the variables in the SQL query so I can run the query... The problem I

Expand Table Rows for Each Delimited Value in One Column's Cells

这一生的挚爱 提交于 2019-12-13 02:16:44
问题 I'm an Excel VBA programmer who's recently discovered Power Query and Power BI. Often, I will receive requests to change something like: Into a sort of un-pivoted version that looks like: This can absolutely be done in VBA, but watching several Power Query videos (and now ordered three books!) It seems it would be much more efficient to do it in Power Query. I get the over-all idea (create a table from the delimited list, for one) but don't know the language of the actual steps. And I really

Delete Power Query queries' custom XML data using VBA

末鹿安然 提交于 2019-12-13 02:01:42
问题 I have Power Query queries in an Excel 2010 file and would like to delete these queries using VBA. so far I can achieve that manually with the following steps: unload Power Query addin run Document Inspector and click to delete Custom XML data The Macro recorder record the following code for step 2. Sub Makro1() ' ' Makro1 Makro ' ' ActiveWorkbook.RemoveDocumentInformation (xlRDIPrinterPath) ActiveWorkbook.RemoveDocumentInformation (xlRDIDocumentProperties) ActiveWorkbook

Complex transformation in Excel Power Query

梦想的初衷 提交于 2019-12-13 01:28:49
问题 I have 2 input Tables. Input Table1 is the source data and input Table 2 is a criteria table . +--------------------------+----------+ +--------------------------+-------+ | TABLE 1 (Source data) | | TABLE 2 (Criterias) | +-------------------------------------+ +----------------------------------+ +-------------------------------------+ +----------------------------------+ | DESCRIPTION | VALUE | | PREFIX | CODE | +-------------------------------------+ +----------------------------------+ |