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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
MH_Ger
Frequent Visitor

Error but nor error when refreshing Sharepoint connection

 

Hi everybody!

 

I am experiencing a weird error that I can neither explain nor get rid of. I am connecting to a Sharepoint folder and append a couple of files. This works wonderfully. The issue is that, everytime I refresh my connections, I get the following error:

 

Error1.png

 

The good news is that everything works perfectly despite the error message. All records are imported, all numbers add up.

The bad news is that this will scare other users. Hence it needs to go away.

 

What is weird about this error that no errors actually exists. There is no column in Power Query that contains the value "Error".

Consequently, the "Table.SelectRowsWithErrors" function yields an empty table (see picture below).

 

Error2.png

 

This is the code for the sharepoint folder connection:

 

 

 

let
    Source = SharePoint.Files("[Url removed]", [ApiVersion = 15]),
    #"Removed Columns" = Table.RemoveColumns(Source,{"Extension", "Date accessed", "Date modified", "Date created", "Attributes"})
in
    #"Removed Columns"

 

 

 

And this is the code for the error query:

 

 

 

let
Source = #"SharePoint Folder",
  #"Detected Type Mismatches" = let
    tableWithOnlyPrimitiveTypes = Table.SelectColumns(Source, Table.ColumnsOfType(Source, {type nullable number, type nullable text, type nullable logical, type nullable date, type nullable datetime, type nullable datetimezone, type nullable time, type nullable duration})),
    recordTypeFields = Type.RecordFields(Type.TableRow(Value.Type(tableWithOnlyPrimitiveTypes))),
    fieldNames = Record.FieldNames(recordTypeFields),
    fieldTypes = List.Transform(Record.ToList(recordTypeFields), each [Type]),
    pairs = List.Transform(List.Positions(fieldNames), (i) => {fieldNames{i}, (v) => if v = null or Value.Is(v, fieldTypes{i}) then v else error [Message = "The type of the value does not match the type of the column.", Detail = v], fieldTypes{i}})
in
    Table.TransformColumns(Source, pairs),
  #"Added Index" = Table.AddIndexColumn(#"Detected Type Mismatches", "Row Number" ,1),
  #"Kept Errors" = Table.SelectRowsWithErrors(#"Added Index", {"Content", "Name", "Folder Path"}),
  #"Reordered Columns" = Table.ReorderColumns(#"Kept Errors", {"Row Number", "Content", "Name", "Folder Path"})
in
  #"Reordered Columns"

 

 

 

Does anyone have any idea?

4 REPLIES 4
watts_jim
Helper II
Helper II

I'm getting the same error - 'detected type mismatches', but no rows showing errors.

MH_Ger
Frequent Visitor

Hi! Sadly, none of your tips really helped. However, I was able to solve it myself. I replaced "SharePoint.Files" with "SharePoint.Contents" when loading all data into Power BI. I then simply navigated to my folder and voila: No errors when refreshing! 

Anonymous
Not applicable

@MH_Ger 

 

Go to Data Source Settings  -> Edit Permissions -> Re-enter credentials and log in. I would also suggest you to check that the account used to connect to the SharePoint site has proper permissions.

 

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

mussaenda
Super User
Super User

Hi @MH_Ger ,

 

Try to check the Date fileds. Sometimes that is what causing the error.

If you want to see the error, on the lower left of the power query, double click this

2021_09_23_10_59_49_10.1.39.30_Remote_Desktop_Connection.png

and then Replace the errors with null and try again.

 

Hope this helps.

 

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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