power query

power query

962 bookmarks
Custom sorting
Finding text strings of table inside text strings of other table
Finding text strings of table inside text strings of other table
Select Table 2, click the Query tab, and click Reference. This will create a new query that references Table 2 and will allow us to add a lookup column without enabling Fast Combine.Add a custom column with the following formula: List.First(List.Select(Table1[Product],(productName) = Text.Contains(productName, [Product])))Viola!
Power_BI_tips·social.technet.microsoft.com·
Finding text strings of table inside text strings of other table
Implementing Common Calculations In Power Query – Chris Webb's BI Blog
Implementing Common Calculations In Power Query – Chris Webb's BI Blog
let Source = Excel.CurrentWorkbook(){[Name="Table4"]}[Content], Subtotals = Table.Group(Source, {"Category"}, {{"Category Sales", each List.Sum([Sales]), type number}}), JoinTables = Table.Join(Source, "Category", Subtotals, "Category"), InsertedCustom = Table.AddColumn(JoinTables, "Share", each [Sales]/[Category Sales]), RemovedColumns = Table.RemoveColumns(InsertedCustom,{"Category Sales"})in RemovedColumns
Power_BI_tips·blog.crossjoin.co.uk·
Implementing Common Calculations In Power Query – Chris Webb's BI Blog
Automatically remove empty columns and rows from a table in Excel using Power Query - DataChant
Automatically remove empty columns and rows from a table in Excel using Power Query - DataChant
Follow Me In today’s tutorial we will solve a very common challenge in Excel. You start with an Excel table and you wish to condense it by removing all the columns and/or rows which are entirely empty, and usually you don’t have prior knowledge which columns and rows are empty. For example, In the screenshot …
Power_BI_tips·datachant.com·
Automatically remove empty columns and rows from a table in Excel using Power Query - DataChant
Matchlists/tables in power query
Matchlists/tables in power query
let fxContain = (txt as text, idx as number) = let Result = if Text.Contains(txt,ListB{idx}) then ListB{idx} else if idx = ListCountB then null else @fxContain(txt,idx+1) in Result, ListA = {"help me rhonda", "in my room", "good vibrations", "god only knows"}, ListB = {"room", "me", "only", "help"}, ListCountB = List.Count(ListB)-1, ListC = List.Transform(ListA, each fxContain(_,0))in ListC
Power_BI_tips·social.technet.microsoft.com·
Matchlists/tables in power query
How to use Record.Field for a list
How to use Record.Field for a list
Hi bjzk. You're going to have issues if you use Table.ColumnNames(GetH123Prices) to derive the equivalent of ColumnList in my example. Instead, you'll need to specify the names of the columns you want to check against (or use a formula to automatically whittle down the list of column names to exclude H0 and any other columns you don't want to check). For example:= Table.AddColumn(GetH123Prices, "ContainsH0", each List.Contains(Record.FieldValues(Record.RemoveFields(_, "H0_Price")), [H0_Price]))EhrenTuesday, August 09, 2016 6:26 PMReply | QuoteEhren - MSFTMicrosoft (MSFT) 6,290 PointsOwner
Power_BI_tips·social.technet.microsoft.com·
How to use Record.Field for a list
Text Contains Any Of
Text Contains Any Of
let ListOfWords = List.Buffer({"ed", "us", "an"}), Source = Table.FromColumns({{"red bus","blue train", "orange airplane"}}, {"some text"}), AddColumn = Table.AddColumn(Source, "Custom", (x) = List.AnyTrue(List.Transform(ListOfWords, each Text.Contains(x[some text], _))) )in AddColumn
Power_BI_tips·social.technet.microsoft.com·
Text Contains Any Of
Matchlists/tables in power query
Matchlists/tables in power query
let fxContain = (txt as text, idx as number) = let Result = if Text.Contains(txt,ListB{idx}) then ListB{idx} else if idx = ListCountB then null else @fxContain(txt,idx+1) in Result, ListA = {"help me rhonda", "in my room", "good vibrations", "god only knows"}, ListB = {"room", "me", "only", "help"}, ListCountB = List.Count(ListB)-1, ListC = List.Transform(ListA, each fxContain(_,0))in ListC
Power_BI_tips·social.technet.microsoft.com·
Matchlists/tables in power query