Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello, something very strange is happening to me, I have a filtered table in Power Query with a single record, I perform some simple transformations on this table and I am left with two columns (just for the purpose of being able to see the complete image) as shown in image 1, I merge this table with another table that also has a single record and 2 columns (only for the purpose of being able to see the complete image), expanding the table modifies the value of the "To_date" column, In reality several values are changed in several columns, could it be a product problem?
This is my PBI Version: 2.129.1229.0 64-bit (mayo de 2024)
Thank's
Hi @Anonymous
Thank you for your help.
The data is in a sql express on my computer. This problem had not happened to me before, however, the same thing happened to a colleague. To solve the problem I had to perform the left join before the group by, in that case there were no problems when expanding the table. I refreshed all the data from power query and the problem persists, I also refreshed from PBI desktop and the problem persists. I attach the script used in case it is useful.
let
Source = Stock,
RemovedOtherColumns = Table.SelectColumns(Source,{"Material", "To_Date", "Closing_Stock", "ValA", "Closing_Value"}),
FilteredRows1 = Table.SelectRows(RemovedOtherColumns, each [Material] = 205404),
FilteredRows = Table.SelectRows(FilteredRows1, each ([Closing_Stock] <> 0)),
#"Changed Type" = Table.TransformColumnTypes(FilteredRows,{{"To_Date", type date}}),
RenamedColumns = Table.RenameColumns(#"Changed Type",{{"ValA", "Planta"}}),
SortedRows = Table.Sort(RenamedColumns,{{"Material", Order.Ascending}, {"Planta", Order.Ascending}, {"To_Date", Order.Descending}}),
GroupedRows = Table.Group(SortedRows, {"Material", "Planta"}, {{"Data", each _, type table [Material=nullable number, Closing_Stock=nullable number, ValA=nullable text, Closing_Value=nullable number, To_Date=nullable date]}}),
AddedTabletoRecord = Table.AddColumn(GroupedRows, "Custom", each Table.First([Data])),
RemovedOtherColumns1 = Table.SelectColumns(AddedTabletoRecord,{"Custom"}),
ExpandedCustom = Table.ExpandRecordColumn(RemovedOtherColumns1, "Custom", {"Material", "Closing_Stock", "Planta", "Closing_Value", "To_Date"}, {"Material", "Closing_Stock", "Planta", "Closing_Value", "To_Date"}),
ChangedType = Table.TransformColumnTypes(ExpandedCustom,{{"Material", Int64.Type}, {"Closing_Stock", type number}, {"Planta", type text}, {"Closing_Value", Int64.Type}, {"To_Date", type date}}),
MergedProducto = Table.NestedJoin(ChangedType, {"Material"}, Producto, {"Codigo_Material"}, "Producto", JoinKind.LeftOuter),
ExpandedProducto = Table.ExpandTableColumn(MergedProducto, "Producto", {"Net_weight", "Costo_Traslado_Planta"}, {"Net_weight", "Costo_Traslado_Planta"}),
InsertedCostoUnitario = Table.AddColumn(ExpandedProducto, "CostoUnitario", each [Closing_Value] / [Closing_Stock], type number),
InsertedCosto = Table.AddColumn(InsertedCostoUnitario, "Costo", each [CostoUnitario] + [Costo_Traslado_Planta], type number)
in
InsertedCosto
Hi @Ceyzaguirre
I tested with the same version of PBI Desktop and didn't experience the same issue. May I know what data source are you using? Does this problem happen with other data sources? Have you tried Refreshing all preview in Power Query Editor?
Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!