@Mike I tried to solve it in power query and now for your OrderID, the average will be shown accurately.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUQr2DgVRhkqxOnABI3QBY7iAEUTAFEgZIQuYQQRiAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [OrderID = _t, SKU = _t, #"Deliver Days" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"OrderID", Int64.Type}, {"SKU", type text}, {"Deliver Days", Int64.Type}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Deliver Days", "Delivery Days"}}),
#"Added Index" = Table.AddIndexColumn(#"Renamed Columns", "Index", 1, 1, Int64.Type),
#"Reordered Columns" = Table.ReorderColumns(#"Added Index",{"Index", "OrderID", "SKU", "Delivery Days"}),
#"Added Custom" = Table.AddColumn(#"Reordered Columns", "Custom", each if [Index]=1 then null else #"Reordered Columns"{[Index]-2}[Delivery Days]),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "Final Delivery Days", each if [Custom] = null then [Delivery Days] else if [Custom] <> [Delivery Days] then [Delivery Days] else null),
#"Changed Type1" = Table.TransformColumnTypes(#"Added Custom1",{{"Final Delivery Days", Int64.Type}}),
#"Removed Columns" = Table.RemoveColumns(#"Changed Type1",{"Custom"})
in
#"Removed Columns"
Attaching the PBIX file. Let me know if it works.
Average_Dilivery_Days.pbix (33.8 KB)
Thanks.