powerquery

Power Query: how to add one to a column when a specific values appear in an other column

蓝咒 提交于 2020-05-08 14:25:48
问题 I have an ID column and I am looking for ways to increment my IDs each time a specific item appears in my Geography column ( ItalyZ , ItalyM , UKY or UKM ) is found. The ID of ItalyZ starts at 0 and ends at 4000. The ID of ItalyB starts at 4000 and ends at 8000. The ID of UKY starts at 0 and ends at 4000. The ID of UKM starts at 4000 and ends at 8000. However, I am refreshing my file, and I will thus have from time to time new arrivals of "geographies" without the origins or first IDs. These

How can I loop trough elements in columns in a powerbi function?

大憨熊 提交于 2020-04-30 10:24:23
问题 I want to write a Function for cleaning numbers. While leaving them as text. So, in my queries I want to use e.g.: = CleanRN(PrevQueryTable, {"NumericTextColumn"}) The function is supposed to remove all non numeric characters and leading zeroes in not already numeric texts. (But the function is not the point for this question.) So in the queries themselves I can go with = Table.ReplaceValue(Benutzerdefiniert2,"_","",Replacer.ReplaceText,{"ONKZ/RufNr"}) or = Table.ReplaceValue(#"Ersetzter

How can I loop trough elements in columns in a powerbi function?

巧了我就是萌 提交于 2020-04-30 10:23:42
问题 I want to write a Function for cleaning numbers. While leaving them as text. So, in my queries I want to use e.g.: = CleanRN(PrevQueryTable, {"NumericTextColumn"}) The function is supposed to remove all non numeric characters and leading zeroes in not already numeric texts. (But the function is not the point for this question.) So in the queries themselves I can go with = Table.ReplaceValue(Benutzerdefiniert2,"_","",Replacer.ReplaceText,{"ONKZ/RufNr"}) or = Table.ReplaceValue(#"Ersetzter

Matching rows between two columns to get an exact or partial match

ぐ巨炮叔叔 提交于 2020-04-18 12:37:07
问题 I’m having a problem writing a query in power bi for matching two rows partially or completely. In addition to that I’m trying to calculate the match percentage if found and put the results in a new column. The actual dataset contains a lot of rows and tables but for the sake of this example I’m using only 4 columns. The columns 'ID' and 'Text' are uniquely identified. 'KI ID' and 'KI Test' are also unique but they are not related to columns 'ID' and 'Text' only when a match occurs. What I

PowerQuery - Folder Query import new files

谁都会走 提交于 2020-04-17 14:48:13
问题 If I have created a PowerQuery function that imports XML from a folder, how in the same excel file do I reuse the query when there are new files in the folder to only include data from those new files and append the data to the current table? 回答1: If you start a Power Query using From File / From Folder and browse to your folder, you will see each file represented as a row in a table, with columns such as Date modified . You can filter that list using Date/Time filters on Date modified or by

PowerQuery - Folder Query import new files

北城余情 提交于 2020-04-17 14:38:11
问题 If I have created a PowerQuery function that imports XML from a folder, how in the same excel file do I reuse the query when there are new files in the folder to only include data from those new files and append the data to the current table? 回答1: If you start a Power Query using From File / From Folder and browse to your folder, you will see each file represented as a row in a table, with columns such as Date modified . You can filter that list using Date/Time filters on Date modified or by

Calculated columns as axis & value

爷,独闯天下 提交于 2020-03-05 02:06:48
问题 I have a bunch of calculated DAX columns that I want to show as a visual. If I use a normal bar chart I get the following image, Barchart 1, where because I do not have any fields in the axis field. The titles of each of the calculated columns are what I want the x-axis to be similar to how it is in the funnel chart below. The funnel chart only requires the value field to be filled in and it creates the following image which is kind of what I want but it needs to be vertical similar to the

PowerQuery multiple files and add column

十年热恋 提交于 2020-01-26 04:09:42
问题 I have the inline PowerQuery to automate my weekly reporting. Since I am new to power query I followed up this tutorial and try to add a custom column so I can use it to see week over week improvements, the thing is that the column that is added is not named "Week" but instead it is called the name of the file. From this webpage the second parameter is column name. I do not find why column name is filename instead of the name "week". let ExcelFile = (FilePath, FileName) => let Source = Folder

PowerQuery COUNTIF Previous Dates

冷暖自知 提交于 2020-01-25 11:27:25
问题 I'm a little rusty on PowerQuery. I need to count "previous" entries in the same table. For example, let's say we have a table of car sales. For the purposes of PowerQuery, this table will be named tblCarSales I need to add two aggregate columns. The first aggregate column is the count of previous sales. The Excel formula would be =COUNTIF([Sale Date],"<"&[@[Sale Date]]) The second aggregate column is the count of previous sales by make . The Excel formula would be =COUNTIFS([Sale Date],"<"&[

Reading the first n rows of a csv without parsing the whole file in Power Query

∥☆過路亽.° 提交于 2020-01-25 08:55:07
问题 I have these csv data files with my relevant data in the first five rows and a bunch of mal formmatted data below it. When I use filter rows it still reads in all of the data below which causes problems for me. This is problematic because I am reading in a whole folder's worth and some of these files have a different number of columns below the rows I'm interested in. Those columns or data below those first five rows I do not need, but power query throws errors when it is looking for the same