query
4 TopicsCompare values in 2 colums return value from 3rd column in a new colum
Hi all, Trying to get my head around the following in Power Query. I'm trying to compare 2 columns from 2 seperate table to find a common value I have table Shipment_Data with column Consol ID and table Consol_Data with colum Reference. The values in column Reference should be contained in the colum Consol ID, if it matches it should then copy the value from table Consol_Data, column MAWB from the same row and create a new column in table Shipment_Data with the respective value from table Consol_Data, column MAWB As there might be multiple values in column Consol ID.980Views0likes3CommentsHelp with Power BI query optimization
Hi All, I need your help to optimize this power BI query. Currently, the query works very slow (query doesnt return result even after 3 days). let Source = Sql.Database("chvpkw8ahsv117", "hmparsdmd"), Staging_Transactions_Summary = Source{[Schema="Staging",Item="Transactions_Summary"]}[Data], #"Removed Other Columns" = Table.SelectColumns(Staging_Transactions_Summary,{"TransactionDate", "TransactionYYMM", "LocationID", "CardTypeDesc", "FuelTypeDesc", "td_acct_no", "PumpNumber", "IndoorOutDoor", "NFCUsed", "PilotSites", "TransactionCount", "Gallons", "FuelDollars"}), #"Filtered Rows" = Table.SelectRows(#"Removed Other Columns", each ([IndoorOutDoor] = "Outdoor") and ([PilotSites] = "Yes") and ([NFCUsed] = "No")), #"Changed Type" = Table.TransformColumnTypes(#"Filtered Rows",{{"LocationID", Int64.Type}}), #"Sorted Rows" = Table.Sort(#"Changed Type",{{"LocationID", Order.Ascending},{"td_acct_no", Order.Ascending},{"TransactionDate", Order.Ascending}}), #"Reordered Columns" = Table.ReorderColumns(#"Sorted Rows",{"LocationID", "td_acct_no", "TransactionDate", "CardTypeDesc", "FuelTypeDesc", "PumpNumber", "IndoorOutDoor", "NFCUsed", "PilotSites", "TransactionCount", "Gallons", "FuelDollars"}), #"Added Index" = Table.AddIndexColumn(#"Reordered Columns", "Index", 1, 1), #"Merged Queries" = Table.NestedJoin(#"Added Index",{"LocationID", "td_acct_no","Index"},#"Staging Transactions_Summary",{"LocationID", "td_acct_no","Index"},"NewColumn",JoinKind.LeftOuter), #"Expanded NewColumn" = Table.ExpandTableColumn(#"Merged Queries", "NewColumn", {"TransactionDate"}, {"NewColumn.TransactionDate"}), #"Renamed Columns" = Table.RenameColumns(#"Expanded NewColumn",{{"NewColumn.TransactionDate", "NextTransactionDate"}}), #"Filtered Rows1" = Table.SelectRows(#"Renamed Columns", each ([NextTransactionDate] <> null)), #"Added Custom" = Table.AddColumn(#"Filtered Rows1", "DaysFromLastTrans", each if [NextTransactionDate] <> null then Duration.Days(Duration.From([NextTransactionDate]-[TransactionDate])) else null), #"Grouped Rows" = http://itopssqldb.database.windows.net(#"Added Custom", {"LocationID", "TransactionYYMM", "td_acct_no", "CardTypeDesc", "FuelTypeDesc", "IndoorOutDoor", "NFCUsed"}, {{"TransactionCount", each Table.RowCount(_), type number}, {"TotalGallons", each List.Sum([Gallons]), type number}, {"TotalFuelDollars", each List.Sum([FuelDollars]), type number}, {"TotalDays", each List.Sum([DaysFromLastTrans]), type number}}), #"Added Custom1" = Table.AddColumn(#"Grouped Rows", "AvgDaysBetweenTrans", each [TotalDays]/[TransactionCount]) in #"Added Custom1"Solved7.9KViews0likes4CommentsDelete the first 10 rows of each file on a "multiple file" table
Hi all, I have a quite specific question for you : I made a query with parameters to get the values of multiple excel files (hosted on sharepoint) into one single table, that I will call "multiple file table" or "consolidation table". Because all these files have exactly the same structure, I can see them in one single Power BI Table with same columns for each. In the applied steps of the Table, I had to remove the First 10 rows of the Excel file (it contains useless values), but it just did it for the 1st file I injected. What I would like is : create a formula to remove first 10 rows each time my Table is processing a new file. (What I did until now is a series of "= Table.SelectRows(#"Renamed Columns", each [field1] <> null and [field2] <> null" ... but it is quite ugly and not developer friendly.) I hope it is clear for you. Many thanks in advanceSolved16KViews0likes3Comments