Forum Discussion
Power Query not identifying all rows from excel unless I resort in excel and save???
Good Morning,
In answer to your questions.
The files are stored on a business server that is connected to Power BI via a gateway that is set t refresh daily.
I created a matrix that shows the specific information Ie row count and some specifics aound the data. When i check the row count of populated in the excel file I can compare the row count with this number.
Its really strange when I sort the information largest to smallest on a column with no duplicated information and save the file the numbers will then match.
Here is the query code:
let
Source = Excel.Workbook(File.Contents("*Source location removed*\List of Orders.xlsx"), null, true),
#"Maintenance Orders_Sheet" = Source{[Item="Maintenance Orders",Kind="Sheet"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(#"Maintenance Orders_Sheet", [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Order Number", Int64.Type}, {"Priority", Int64.Type}, {"Priority Descr", type text}, {"Equipment Nb", Int64.Type}, {"Equipment Descr", type text}, {"Description", type text}, {"Location and Account Assignment for Technical Object", Int64.Type}, {"ILOA Individual", type text}, {"System Condition Descr", type text}, {"Maintenance Planning Plant", Int64.Type}, {"Planner Group for Customer Service and Plant Maintenance", type text}, {"Object ID of the Work Center Descr", type text}, {"Maintenance Plan", Int64.Type}, {"Maintenance Plan Call Nb", type text}, {"Maintenance Item", Int64.Type}, {"Order Nb", Int64.Type}, {"PM Order Reference Date", type date}, {"Time of Reference Date", type datetime}, {"Maintenance Processing Phase", type text}, {"Maintenance Activity Type", type text}, {"Notification Nb", type any}, {"Material Nb", type any}, {"Order Type", type text}, {"Order Type Descr", type text}, {"Reference Order Nb", type any}, {"Entered By", type text}, {"Created On", type date}, {"Last changed by", type text}, {"Change date for Order Master", type date}, {"Company Code", Int64.Type}, {"Plant", Int64.Type}, {"Plant Descr", type text}, {"Responsible Cost Center", Int64.Type}, {"Location Plant", Int64.Type}, {"Release Date", type date}, {"Technical Completion Date", type date}, {"Close Date", type date}, {"Object Nb", type text}, {"Profit Center", type text}, {"Time Created", type datetime}, {"Changed At", type datetime}, {"Main Work Center for Maintenance Tasks", type text}, {"Cost Center", Int64.Type}, {"Functional Location", type text}, {"ABC Indicator for Technical Object", type text}, {"Maintenance Plant", Int64.Type}, {"Start Date", type date}, {"Finish Date", type date}, {"Scheduled Release Date", type date}, {"Scheduled Start", type date}, {"Scheduled Finish", type date}, {"Actual Start Date", type date}, {"Actual Finish Date", type any}, {"Confirmed Order Finish Date", type date}, {"Actual Release Date", type date}, {"Planned Release Date", type any}, {"Nb of Reservation dependent Requirements", Int64.Type}, {"Total Order Quantity", Int64.Type}, {"Task List Type", type text}, {"Key for Task List Group", Int64.Type}, {"Responsible Planner Group", type text}, {"Application of the Task List", type text}, {"Group Counter", Int64.Type}, {"Task List Usage", Int64.Type}, {"Valid From Date", type date}, {"Basic Start Time", type time}, {"Basic Finish Time", type text}, {"Scheduled Start Time", type text}, {"Scheduled Finish Time", type text}, {"Actual Start Time", type time}, {"Confirmed Order Finish Time", type time}}),
#"Changed Type1" = Table.TransformColumnTypes(#"Changed Type",{{"Maintenance Planning Plant", type text}, {"Order Nb", type text}, {"Notification Nb", type text}, {"Material Nb", type text}, {"Reference Order Nb", type text}, {"Company Code", type text}, {"Plant", type text}, {"Responsible Cost Center", type text}, {"Location Plant", type text}, {"Cost Center", type text}, {"Maintenance Plant", type text}, {"Actual Finish Date", type date}, {"Planned Release Date", type date}, {"Nb of Reservation dependent Requirements", type text}, {"Key for Task List Group", type text}, {"Group Counter", type text}, {"Task List Usage", type text}, {"Basic Finish Time", type text}, {"Order Number", type text}, {"Equipment Nb", type text}, {"Location and Account Assignment for Technical Object", type text}, {"Maintenance Item", type text}, {"Maintenance Plan", type text}, {"Priority", type text}}),
#"Inserted Text Before Delimiter" = Table.AddColumn(#"Changed Type1", "Text Before Delimiter", each Text.BeforeDelimiter([Functional Location], "-", 2), type text),
#"Renamed Columns" = Table.RenameColumns(#"Inserted Text Before Delimiter",{{"Text Before Delimiter", "FLOC LVL 3"}}),
#"Sorted Rows" = Table.Sort(#"Renamed Columns",{{"Order Number", Order.Descending}})
in
#"Sorted Rows"