Power query trouble

hnorgaar

New Member
Joined
Jul 21, 2018
Messages
31
Office Version
  1. 2019
Platform
  1. Windows
Need some help to why this query ends up with errors caused by a mixed field (Car engines) all look good in the query, but when loading errors. I try to keep the format as Text and succeeds, but still trouble

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Tekst1", type text}, {"Overskrift", type text}, {"Price out", type text}, {"Pic2", type text}, {"Pic1", type text}, {"PartCode", type text}, {"YearNo", type text}, {"Engine", type text}, {"Model", type text}, {"Make", type text}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"PartCode", "Overskrift", "Tekst1"}, {{"Count", each _, type table [Make=nullable text, Model=nullable text, Engine=nullable text, YearNo=nullable text, BHP=nullable number, PartCode=nullable text, Pic1=nullable text, Pic2=nullable text, Price out=nullable number, Overskrift=nullable text, Tekst1=nullable text]}}),
    #"Added Index" = Table.AddIndexColumn(#"Grouped Rows", "Index", 100000, 1, Int64.Type),
    #"Renamed Columns" = Table.RenameColumns(#"Added Index",{{"Index", "Handle"}}),
    #"Expanded Count" = Table.ExpandTableColumn(#"Renamed Columns", "Count", {"Make", "Model", "Engine", "YearNo", "BHP", "PartCode", "Pic1", "Pic2", "Price out", "Overskrift", "Tekst1"}, {"Make", "Model", "Engine", "YearNo", "BHP", "PartCode.1", "Pic1", "Pic2", "Price out", "Overskrift.1", "Tekst1.1"}),
    #"Removed Columns" = Table.RemoveColumns(#"Expanded Count",{"Overskrift.1", "Tekst1.1"}),
    #"Reordered Columns" = Table.ReorderColumns(#"Removed Columns",{"Make", "Model", "Engine", "YearNo", "BHP", "PartCode.1", "PartCode", "Overskrift", "Tekst1", "Pic1", "Pic2", "Price out", "Handle"}),
    #"Removed Columns1" = Table.RemoveColumns(#"Reordered Columns",{"PartCode.1"}),
    #"Inserted Merged Column" = Table.AddColumn(#"Removed Columns1", "pic", each Text.Combine({[Pic1], [Pic2]}, ","), type text),
    #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(#"Inserted Merged Column", {{"pic", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "pic"),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"pic", type text}}),
    #"Removed Columns2" = Table.RemoveColumns(#"Changed Type1",{"Pic1", "Pic2"}),
    #"Reordered Columns1" = Table.ReorderColumns(#"Removed Columns2",{"Handle", "Overskrift", "PartCode", "Tekst1", "pic", "Price out", "Make", "Model", "Engine", "YearNo", "BHP"}),
    #"Added Custom" = Table.AddColumn(#"Reordered Columns1", "Collection", each "EBC Bremser"),
    #"Reordered Columns2" = Table.ReorderColumns(#"Added Custom",{"Handle", "Overskrift", "PartCode", "Tekst1", "pic", "Price out", "Collection", "Make", "Model", "Engine", "YearNo", "BHP"}),
    #"Duplicated Column" = Table.DuplicateColumn(#"Reordered Columns2", "Collection", "Collection - Copy"),
    #"Duplicated Column1" = Table.DuplicateColumn(#"Duplicated Column", "Collection", "Collection - Copy.1"),
    #"Added Custom1" = Table.AddColumn(#"Duplicated Column1", "Image Position", each ""),
    #"Reordered Columns3" = Table.ReorderColumns(#"Added Custom1",{"Handle", "Overskrift", "PartCode", "Tekst1", "pic", "Image Position", "Price out", "Collection", "Make", "Model", "Engine", "YearNo", "BHP", "Collection - Copy", "Collection - Copy.1"}),
    #"Renamed Columns1" = Table.RenameColumns(#"Reordered Columns3",{{"Collection - Copy.1", "Forhandler"}, {"Collection - Copy", "Vendor"}, {"BHP", "HK"}, {"pic", "Image Src"}, {"Make", "Mærke"}, {"Engine", "Motor"}, {"YearNo", "Årgang"}}),
    #"Reordered Columns4" = Table.ReorderColumns(#"Renamed Columns1",{"Handle", "Overskrift", "PartCode", "Tekst1", "Image Src", "Image Position", "Vendor", "Price out", "Collection", "Mærke", "Model", "Motor", "Årgang", "HK", "Forhandler"}),
    #"Renamed Columns2" = Table.RenameColumns(#"Reordered Columns4",{{"Tekst1", "Body (HTML)"}, {"PartCode", "Variant SKU"}, {"Overskrift", "Title"}, {"Forhandler", "category"}}),
    #"Removed Duplicates" = Table.Distinct(#"Renamed Columns2")
in
    #"Removed Duplicates"
 
Last edited by a moderator:

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Forgot to mention is the field named Engine and later renamed to Motor giving me trouble
 
Upvote 0
Which step do the errors occur at and what is the actual error description?
 
Upvote 0

Forum statistics

Threads
1,223,875
Messages
6,175,114
Members
452,613
Latest member
amorehouse

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top