'Power Query Merge Queries Data Format Error - Cant Convert to Number

Intent - I have 2 tables "Diagnosis" and "PHQ9 Score". Both tables have two common columns, Chart Number and Date of Service. In each table I merged these 2 columns and used the default name "Merged" in both. I then selected merge queries and used the "Merged" column in each table as the reference column to complete the merge query. I am intending to bring in data from the PHQ9 table into the Diagnosis table. power query then creates a column with the word "Table" in each cell. I then use the drop down in the new column to select the column of data from the PHQ9 table I wish to have added to the Diagnosis table.

Here is the result:
enter image description here

I have looked for data type issues but no luck.

let
    Source = Folder.Files("\\dc\finance team\Finance Team\PHQ9\Patrick Testing\Data\Diagnosis"),
    #"Filtered Hidden Files1" = Table.SelectRows(Source, each [Attributes]?[Hidden]? <> true),
    #"Invoke Custom Function1" = Table.AddColumn(#"Filtered Hidden Files1", "Transform File", each #"Transform File"([Content])),
    #"Renamed Columns1" = Table.RenameColumns(#"Invoke Custom Function1", {"Name", "Source.Name"}),
    #"Removed Other Columns1" = Table.SelectColumns(#"Renamed Columns1", {"Source.Name", "Transform File"}),
    #"Expanded Table Column1" = Table.ExpandTableColumn(#"Removed Other Columns1", "Transform File", Table.ColumnNames(#"Transform File"(#"Sample File"))),
    #"Changed Type" = Table.TransformColumnTypes(#"Expanded Table Column1",{{"Source.Name", type text}, {"Name", type text}, {"Data", type any}, {"Item", type text}, {"Kind", type text}, {"Hidden", type logical}}),
    #"Expanded Data" = Table.ExpandTableColumn(#"Changed Type", "Data", {"Column1", "Column2", "Column3", "Column4", "Column5"}, {"Data.Column1", "Data.Column2", "Data.Column3", "Data.Column4", "Data.Column5"}),
    #"Removed Top Rows" = Table.Skip(#"Expanded Data",1),
    #"Promoted Headers" = Table.PromoteHeaders(#"Removed Top Rows", [PromoteAllScalars=true]),
    #"Removed Columns" = Table.RemoveColumns(#"Promoted Headers",{"Depression 2.xlsx", "Page1_1", "Column3", "Page1_1_1", "Sheet", "false"}),
    #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(#"Removed Columns", {{"ICD-10 Codes", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "ICD-10 Codes"),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"ICD-10 Codes", type text}}),
    #"Filtered Rows" = Table.SelectRows(#"Changed Type1", each Text.Contains([#"ICD-10 Codes"], "F32") or Text.Contains([#"ICD-10 Codes"], "F33") or Text.Contains([#"ICD-10 Codes"], "R45")),
    #"Replaced Value" = Table.ReplaceValue(#"Filtered Rows"," ","",Replacer.ReplaceText,{"ICD-10 Codes"}),
    #"Extracted Date" = Table.TransformColumns(#"Replaced Value",{}),
    #"Changed Type2" = Table.TransformColumnTypes(#"Extracted Date",{{"Service Date", type date}, {"Patient Chart Number", Int64.Type}}),
    #"Duplicated Column" = Table.DuplicateColumn(#"Changed Type2", "Patient Chart Number", "Patient Chart Number - Copy"),
    #"Duplicated Column1" = Table.DuplicateColumn(#"Duplicated Column", "Service Date", "Service Date - Copy"),
    #"Merged Columns" = Table.CombineColumns(Table.TransformColumnTypes(#"Duplicated Column1", {{"Patient Chart Number - Copy", type text}, {"Service Date - Copy", type text}}, "en-US"),{"Patient Chart Number - Copy", "Service Date - Copy"},Combiner.CombineTextByDelimiter("", QuoteStyle.None),"Merged"),
    #"Merged Queries" = Table.NestedJoin(#"Merged Columns", {"Merged"}, #"PHQ9 Score", {"Merged"}, "PHQ9 Score", JoinKind.LeftOuter),
    #"Expanded PHQ9 Score" = Table.ExpandTableColumn(#"Merged Queries", "PHQ9 Score", {"Note Field Value"}, {"PHQ9 Score.Note Field Value"})
in
    #"Expanded PHQ9 Score"


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source