powerquery

How can I produce a regular Excel formula as the result of a query?

非 Y 不嫁゛ 提交于 2020-01-24 22:08:13
问题 I have a large and complicated Excel query, which works as desired. However, I'm implementing some real-time data-validation features (i.e. not requiring a data refresh), and I need to have a regular excel formula in one of the columns of my query results. This formula would perform a real-time data comparison using other sheets in the workbook, intentionally independent from the query itself. Can I add a custom column with no value? I assume the values null or "" would overwrite any pre

Power BI. Matrix two columns under on column

一曲冷凌霜 提交于 2020-01-24 19:24:26
问题 This is the desired layout of the matrix that I need. I need to have two columns under one column: However, I ended up with this(I used different values, so the values might be slightly different.): With the following columns in the matrix fields: This is a sample of the dataset. Total Units sum up columns A and B. The Order column sorts the Status column: STATUS A B Total Units Order ABC 3 0 3 1 DEF 0 6 6 2 ABC 3 2 5 1 ABC 5 6 11 1 GHI 0 4 4 3 ABC 5 3 8 1 DEF 0 9 9 2 How do I get my desired

PowerBI Query WebMethod.Post returns Expression.Error: We cannot convert the value “POST” to type Function

冷暖自知 提交于 2020-01-24 00:37:06
问题 I'm using a website that requires that their API key AND query data be submitted using Webform.Post method. I'm able to get this to work in Python, C# and I'm even able to construct and execute a cURL command which returns a usable JSON file that Excel can parse. I am also using Postman to validate my parameters and everything looks good using all these methods. However, my goal is to build a query form that I can use within Excel but I can't get past this query syntax in PowerBi Query. For

Power Query to Filter a SQL view based on an Excel column list

点点圈 提交于 2020-01-23 03:45:47
问题 Is there a way to filter a SQL view based on a list of values in an excel table column using Power Query? I have a SQL view that returns a large set of data (millions of records or properties). Users want to filter that based on an excel table column of property IDs. I know I can just do a merge join based on the property ID between the view and the excel column in power query. But it looks like the merge brings in the millions of records first then filtered it in the join. Which takes a long

Having values persist in column names?

主宰稳场 提交于 2020-01-16 08:50:13
问题 Thanks to another Stack Overflow user I'm able to capture today's date and insert it into my column headers. However each time I refresh the data it refreshes the date. Is there a way using Power Query to make the date stick after it is applied? I don't want it refreshed after the initial calculation. So if it gets set to 5/6/2019 on 5/6, when I refresh the data on 5/8 it's changing to 5/8/2019. I would like it to stay at 5/6/2019. Here is the code that was provided to insert the dates: Let .

Convert column to cell string Power Query

假装没事ソ 提交于 2020-01-16 05:14:08
问题 I need to fit all the values of a column in Power Query into a 1-cell string separated by commas, as the example below: To do this, I have the following piece of code: let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content], #"Transposed Table" = Table.Transpose(Source), #"Merged Columns" = Table.CombineColumns(#"Transposed Table",{"Column1", "Column2", "Column3"},Combiner.CombineTextByDelimiter(",", QuoteStyle.None),"Merged"), #"KeepString" = #"Merged Columns"[Merged]{0} in #

Power query M the IN operator

流过昼夜 提交于 2020-01-15 09:41:30
问题 What would be equivalent of SQL IN operator for Power BI. Just like in clause: where [Column1] IN ('Value1', 'Value2', 'Value3') I am looking for M solution (not DAX). 回答1: You can use the List.Contains function. For example, = Table.SelectRows(Table1, each List.Contains({'Value1', 'Value2', 'Value3'}, [Column1])) will filter Table1 to include only rows where [Column1] is contained in the given list. 来源: https://stackoverflow.com/questions/51740679/power-query-m-the-in-operator

powerquery split column by variable field lengths

ぃ、小莉子 提交于 2020-01-13 13:09:52
问题 In PowerQuery I need to import a fixed width txt file (each line is the concatenation of a number of fields, each field has a fixed specific length). When I import it I get a table with one single column that contains the txt lines, e.g. in the following format: AAAABBCCCCCDDD I want to add more columns in this way: Column1: AAAA Column2: BB Column3: CCCCC Column4: DDD In other words the fields composing the source column are of known length, but this length is not the same for all fields (in

How do I comment in Power Query M?

谁说我不能喝 提交于 2020-01-12 11:57:18
问题 Is there a way to comment M code / comment out lines or blocks of code? 回答1: M supports two different types of comments: Single line comments can be started with // You can comment out multiple lines or comment out text in the middle of a line using /* */ (e.g. = 1 + /* some comment */ 2 ) Comments might seem to disappear in the formula bar if they are at the end of the line, but they are still there. You can verify this by looking at your code in the Advanced Editor. 来源: https:/

How do I comment in Power Query M?

吃可爱长大的小学妹 提交于 2020-01-12 11:57:09
问题 Is there a way to comment M code / comment out lines or blocks of code? 回答1: M supports two different types of comments: Single line comments can be started with // You can comment out multiple lines or comment out text in the middle of a line using /* */ (e.g. = 1 + /* some comment */ 2 ) Comments might seem to disappear in the formula bar if they are at the end of the line, but they are still there. You can verify this by looking at your code in the Advanced Editor. 来源: https:/