Forum Discussion
Im getting this error with no null values. {We cannot convert the value null to type List}
I have managed to find the particular source of error but fail to understand why.
Long story short: Im have a query that pulls an Excel from my sharepoint. In that file i have several addresses of other excel files in my sharepoint and i merge them. I Power Bi Desktop, I have no issues while refreshing the data, but in refreshing it online automatically i have permit issues. I read in another post that I should refer to each of the excel files individually to unique queries so that the automated refresh runs with no errors. So i created the individual queries to each file.
_QueryFilePR
let
Source = Excel.Workbook(Web.Contents("https://XXX.sharepoint.com/sites/XXX/XXXPR.xlsx"), null, true)
in
SourceThe thing is that in this code i have a the problem:
DatamartFD
let
Source = McDATAMART,
McFilter = Table.SelectRows(Source, each [FCSharepoint] <> null),
McGetQuery = Table.AddColumn(McFilter, "Table Query", each Expression.Evaluate([Query Name],#shared)),
McRemoveOtherCols = Table.SelectColumns(McGetQuery,{"Code",... "XXX"}),
_McAddTablaProyeccion = Table.AddColumn(McRemoveOtherCols,"ExcelQuery", each Excel.Workbook( Web.Contents([FCSharepoint])){[Item=[Proy],Kind="Table"]}[Data]),
//_McAddTablaProyeccion = Table.AddColumn(McRemoveOtherCols,"ExcelQuery", each [Table Query]{[Item=[Proy],Kind="Table"]}[Data]),
_McAddTablaProyeccionX = Table.AddColumn(_McAddTablaProyeccion,"ExcelQueryX", each [Table Query]{[Item=[Proy],Kind="Table"]}[Data]),
.....
in
McEndQuery(I changed the code to shorter names so that is was more readable) As you see, in step McGetQuery i insert each of the first code-queries i have shown for the excel "content" of the individual excel file in a new column "Table Query". There is two steps both called _McAddTablaProyeccion, one of the commented out. The difference is that the first instance shows the table from excel being pulled directly from the sharepoint file, in the second i indirectly refer to it in the queries i individually created from each file. Using either works properly in Power Query. Both tables refer the same file but if i run the code this way (the way shown in the above code), the queries are loaded properly. If I instead use the table i loaded indirectly i get the following error once i close and load:
So my problem is, if i leave it as the first instance, the report works properly but only in Power Bi Desktop. But if i refer to each individual file and try to refer to it in the aggregation query once i load it it will not load. I have checked all the columns and no null values are shown.
I also created another step _McAddTablaProyeccionX to compare side by side if the table is not exact due to refreshing issues but i have here the screen capture of both tables:
As you can see, both tables are the same one for Tabla Proyeccion and another Tabla ProyeccionX. Any ideas?