Forum Discussion
Im getting this error with no null values. {We cannot convert the value null to type List}
Please do not refer to individual Excel files. Instead use the SharePoint Folder connector. That has multiple advantages, including (but not limited to)
- fewer connections
- no need for gateways (unless you attempt Power Query merges)
- no issues with service refresh
Thanks, Already changed it. But Still the same problem. The only way that it works is if I refer the excel directly inside the query.
let
Source = McDATAMART,
McFilter = Table.SelectRows(Source, each [Direccion Flujo de Caja en Sharepoint] <> null and [Caracteristicas Proyeccion] <> null and [Separacion Manual] <> null and [Entregas Manual] <> null and [Tabla Fechas] <> null),
McGetQuery = Table.AddColumn(McFilter, "Tabla Consulta", each Expression.Evaluate([Nombre Consulta],#shared)),
McRemoveOtherCols = Table.SelectColumns(McGetQuery,{"Codigo Etapa Sinco", "Proyecto Nombre Sinco", "Direccion Flujo de Caja en Sharepoint", "Caracteristicas Proyeccion", "Separacion Manual", "Entregas Manual", "Tabla Fechas","Tabla Consulta"}),
_McAddTablaProyeccion = Table.AddColumn(McRemoveOtherCols,"Tabla Proyeccion", each Excel.Workbook( Web.Contents([Direccion Flujo de Caja en Sharepoint])){[Item=[Caracteristicas Proyeccion],Kind="Table"]}[Data]),
//_McAddTablaProyeccion = Table.AddColumn(McRemoveOtherCols,"Tabla Proyeccion", each [Tabla Consulta]{[Item=[Caracteristicas Proyeccion],Kind="Table"]}[Data]),
//_McAddTablaProyeccionX = Table.AddColumn(_McAddTablaProyeccion,"Tabla ProyeccionX", each [Tabla Consulta]{[Item=[Caracteristicas Proyeccion],Kind="Table"]}[Data]),
McGetVelocidad = Table.AddColumn(_McAddTablaProyeccion, "Velocidad Ventas",each [Tabla Proyeccion]{5}[Valores],Int64.Type),
McGetVelocidadEntregas = Table.AddColumn(McGetVelocidad, "Velocidad Entregas",each [Tabla Proyeccion]{7}[Valores] ),
McGetPeriodoMinimo = Table.AddColumn(McGetVelocidadEntregas, "Periodo Minimo",each [Tabla Proyeccion]{9}[Valores] ),
_McAddTablaSeparacion = Table.AddColumn(McGetPeriodoMinimo , "Tabla Separacion", each Excel.Workbook( Web.Contents([Direccion Flujo de Caja en Sharepoint])){[Name=[Separacion Manual]]}[Data]),
//_McAddTablaSeparacion = Table.AddColumn(McGetPeriodoMinimo , "Tabla Separacion", each [Tabla Consulta]{[Name=[Separacion Manual]]}[Data]),
_McAddTablaEntregas = Table.AddColumn(_McAddTablaSeparacion , "Tabla Entregas", each Excel.Workbook( Web.Contents([Direccion Flujo de Caja en Sharepoint])){[Name=[Entregas Manual]]}[Data]),
McPullEntregas = Table.AddColumn( _McAddTablaEntregas,"Promedio Entregas", each Number.RoundUp( List.Average(Table.SelectRows( Table.Transpose(_[Tabla Entregas]), each _[Column1] <> 0)[Column1]))),
McCorrectEntregas = Table.AddColumn( McPullEntregas,"Correccion Entregas", each if [Velocidad Entregas] = -1 then [Promedio Entregas] else [Velocidad Entregas]),
_McAddTableFechas = Table.AddColumn( McCorrectEntregas, "Tabla Fecha",each Excel.Workbook( Web.Contents([Direccion Flujo de Caja en Sharepoint])){[Name=[Tabla Fechas]]}[Data]),
//_McAddTableFechas = Table.AddColumn( McCorrectEntregas, "Tabla Fecha",each [Tabla Consulta]{[Name=[Tabla Fechas]]}[Data]),
McRemoveOtherCols2 = Table.SelectColumns(_McAddTableFechas,{"Codigo Etapa Sinco",
"Proyecto Nombre Sinco", "Tabla Proyeccion", "Velocidad Ventas", "Correccion Entregas", "Tabla Separacion", "Tabla Entregas", "Tabla Fecha"}),
McInventariodeSinco = Table.Buffer( Table.SelectColumns(Table.SelectRows(#"ADI_DTM Inventarios",each [Mc UnidadPPal]=true and [InvEstUnidad]="Disponible"),{"InvNombreProyecto","InvIdUnidad"})),
McPullInventario = Table.AddColumn(McRemoveOtherCols2,"Inventario Sinco",(OT)=> List.Count(Table.SelectRows(McInventariodeSinco,each [InvNombreProyecto] = OT[Proyecto Nombre Sinco])[InvNombreProyecto])),
McFixSeparacion = Table.AddColumn( McPullInventario,"Tabla Separacion Corregida", each FunMcFixaInventario([Tabla Separacion],[Velocidad Ventas],[Inventario Sinco])),
McFixEntregas = Table.AddColumn( McFixSeparacion,"Tabla Entregas Corregida", each FunMcFixaInventario([Tabla Entregas],[Correccion Entregas],[Inventario Sinco])),
McAddFunSeparacion = Table.AddColumn( McFixEntregas,"Fun Separacion",each Mc0FunSeparacion([Tabla Separacion Corregida], [Tabla Fecha])),
McAddFunEntregas = Table.AddColumn( McAddFunSeparacion,"Fun Entregas",each Mc0FunEntregas( [Tabla Fecha],[Tabla Entregas Corregida])),
McAddFunProyeccion = Table.AddColumn( McAddFunEntregas,"Fun Proyeccion",each Mc1FunProyeccionVentas( [Tabla Proyeccion],[Fun Separacion],[Fun Entregas],TablaSMMLV, [Inventario Sinco])),
McClean = Table.SelectColumns(McAddFunProyeccion,{"Codigo Etapa Sinco","Proyecto Nombre Sinco", "Fun Proyeccion"}),
McExpandProyeccion = Table.ExpandTableColumn(McClean, "Fun Proyeccion", {"NumUnidad", "Flujo"}, {"NumUnidad", "Flujo"}),
McExpandFlujo = Table.ExpandTableColumn(McExpandProyeccion, "Flujo", {"Fechas", "Separacion", "Credito", "Subsidio", "Cuota Inicial", "Total", "VentasUnd", "VentasM2", "Ventas$", "EscrituraUnd", "EscrituraM2", "Escritura$"}, {"Fechas","Separacion", "Credito", "Subsidio", "Cuota Inicial", "Total", "VentasUnd", "VentasM2", "Ventas$", "EscrituraUnd", "EscrituraM2", "Escritura$"}),
McChType = Table.TransformColumnTypes(McExpandFlujo,{{"NumUnidad", Int64.Type}, {"Fechas", type date}, {"Separacion", Currency.Type}, {"Credito", Currency.Type}, {"Subsidio", Currency.Type}, {"Cuota Inicial", Currency.Type}, {"Total", Currency.Type}, {"VentasUnd", Int64.Type}, {"VentasM2", type number}, {"Ventas$", Currency.Type}, {"EscrituraUnd", Int64.Type}, {"EscrituraM2", type number}, {"Escritura$", Currency.Type}})
in
McChTypeHere i put the whole query. I inserted an undescore between those steps that only work if i access the Excel directly but shows me the following error if i select the one commented out instead of the other.
It is worth mentioning the above code is used in Query Datamart, the error shown below happens in two depending queries.
McDatamart_Proyeccion_Caja shows null values but none appear: Here i post a profile of columns based on the whole dataset
Also, McDatamart_Proyeccion:Datos depends on the DATAMART query.
- lbendlin2 years agoSuper User
I don't see the change
each Excel.Workbook( Web.Contents([Direccion Flujo de Caja en Sharepoint])){[Name=[Entregas Manual]]}[Data]),- jpmakako2 years agoFrequent Visitor
_McAddTableFechas = Table.AddColumn( McCorrectEntregas, "Tabla Fecha",each Excel.Workbook( Web.Contents([Direccion Flujo de Caja en Sharepoint])){[Name=[Tabla Fechas]]}[Data]), //_McAddTableFechas = Table.AddColumn( McCorrectEntregas, "Tabla Fecha",each [Tabla Consulta]{[Name=[Tabla Fechas]]}[Data]),If i run it this way, is works, If i comment the above statement and uncomment the lower one power query shows no errors but power bi wont load it. I hope that clarifies the code.