Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Syndicate_Admin
Administrator
Administrator

Incomplete txt file upload

Hello

I have a report with many different backgrounds. One of them is a txt with several columns separated by tab. My problem comes because with the last reload I am not loading all the data contained in the txt, it only loads some.

Why is that? Why does it load some data yes and others not without showing any kind of error when reloading?

Thanks in advance.

Best regards

7 REPLIES 7
lbendlin
Super User
Super User

Go to the query editor, Advanced Editor, copy the M code and paste it here after removing sensitive information.

Anonymous
Not applicable

let
Origen = Folder.Files("C:\Users\Datos\POWERBI"),
#"Archivos ocultos filtrados1" = Table.SelectRows(Origen, each [Attributes]?[Hidden]? <> true),
#"Personalizada agregada" = Table.AddColumn(#"Archivos ocultos filtrados1", "Personalizado", each Text.Start([Name], Text.Length([Name]) - 24) = "POWER_BI"),
#"Errores quitados" = Table.RemoveRowsWithErrors(#"Personalizada agregada", {"Personalizado"}),
#"Filas filtradas" = Table.SelectRows(#"Errores quitados", each ([Personalizado] = true)),
#"Columnas quitadas0" = Table.RemoveColumns(#"Filas filtradas",{"Personalizado"}),
#"Invocar función personalizada1" = Table.AddColumn(#"Columnas quitadas0", "Transformar archivo", each #"Transformar archivo de Personas"([Content])),
#"Otras columnas quitadas" = Table.SelectColumns(#"Invocar función personalizada1",{"Transformar archivo"}),
#"Se expandió Transformar archivo" = Table.ExpandTableColumn(#"Otras columnas quitadas", "Transformar archivo", {"Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7", "Column8", "Column9", "Column10", "Column11", "Column12", "Column13"}, {"ID Empleado", "Nombre", "Apellidos", "Id Sexo", "Nombre Sexo", "Fecha de Nacimiento", "Edad", "ID Provincia nacimiento", "Nombre Provincia nacimiento", "ID Comunidad nacimiento", "Nombre comunidad naci.", "ID País nacimiento", "Nombre País nacimiento"}),
#"Tipo cambiado" = Table.TransformColumnTypes(#"Se expandió Transformar archivo",{{"Fecha de Nacimiento", type date}, {"ID Empleado", Int64.Type}, {"Nombre", type any}, {"Apellidos", type any}, {"Nombre Sexo", type text}, {"Nombre Provincia nacimiento", type text}, {"Nombre comunidad naci.", type text}, {"Nombre País nacimiento", type text}, {"Id Sexo", Int64.Type}}),
#"Columnas con nombre cambiado" = Table.RenameColumns(#"Tipo cambiado",{{"Nombre Sexo", "Género"}, {"Nombre Provincia nacimiento", "Nombre provincia nacimiento"}, {"Nombre comunidad naci.", "Nombre comunidad nacimiento"}, {"Nombre País nacimiento", "Nombre país nacimiento"}, {"ID Empleado", "ID"}, {"Fecha de Nacimiento", "Fecha nacimiento"}, {"Id Sexo", "ID Género"}}),
#"Columnas quitadas" = Table.RemoveColumns(#"Columnas con nombre cambiado",{"Edad", "ID Provincia nacimiento", "ID Comunidad nacimiento", "ID País nacimiento"}),
#"Columnas reordenadas2" = Table.ReorderColumns(#"Columnas quitadas",{"Fecha nacimiento", "ID", "Nombre", "Apellidos", "ID Género", "Género", "Nombre provincia nacimiento", "Nombre comunidad nacimiento", "Nombre país nacimiento"}),
#"Valor reemplazado3" = Table.ReplaceValue(#"Columnas reordenadas2","Varon","Varón",Replacer.ReplaceText,{"Género"}),
#"Valor reemplazado5" = Table.ReplaceValue(#"Valor reemplazado3",null,"3",Replacer.ReplaceValue,{"ID Género"}),
#"Tipo cambiado1" = Table.TransformColumnTypes(#"Valor reemplazado5",{{"ID Género", Int64.Type}}),
#"Columnas con nombre cambiado1" = Table.RenameColumns(#"Tipo cambiado1",{{"Nombre país nacimiento", "País nacimiento"}, {"Nombre comunidad nacimiento", "Comunidad nacimiento"}, {"Nombre provincia nacimiento", "Provincia nacimiento"}}),
#"Columnas reordenadas" = Table.ReorderColumns(#"Columnas con nombre cambiado1",{"ID", "Nombre", "Apellidos", "Género", "Provincia nacimiento", "Comunidad nacimiento", "País nacimiento", "Fecha nacimiento"}),
#"Filas filtradas1" = Table.SelectRows(#"Columnas reordenadas", each [ID] <> null and [ID] <> ""),
#"Duplicados quitados" = Table.Distinct(#"Filas filtradas1", {"ID"})
in
#"Duplicados quitados"

Hi @Anonymous ,

First, please check whether these following filter steps to impact the data load of txt file in below table.  Which file in the folder path "C:\Users\Datos\POWERBI" did you try to load the data into Power BI ? Could you please provide some sample data (exclude sensitive data) in the related txt file and some screenshots to describe the missing data which compare to the one in Power BI Desktop?

#"Archivos ocultos filtrados1" = Table.SelectRows(Origen, each [Attributes]?[Hidden]? <> true),

#"Filas filtradas" = Table.SelectRows(#"Errores quitados", each ([Personalizado] = true)),

#"Filas filtradas1" = Table.SelectRows(#"Columnas reordenadas", each [ID] <> null and [ID] <> ""),

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
lbendlin
Super User
Super User

show a sanitized version of your Power Query code.

Anonymous
Not applicable

Sorry, I do not understand what you mean

lbendlin
Super User
Super User

Careful when loading CSV files.  On the first load it will add a "number of expected columns"  option to the connector.  Then, if your CSV file grows wider (as they tend to do) the connection will only load the specified number of columns and throw away all the new ones.  If you don't want that then you need to manually remove the Columns=  option.

Anonymous
Not applicable

No, this is not what happens. The number of columns has not changed, only the number of rows has changed.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.