Power Query Editor - Convert Table to Text

63 views Asked by At

I m trying to format a column to text but i receive an error that i can not convert table to text. I have noticed that some column values mention the word Table as the image shows:

enter image description here

Using the below formula a try to get the value store in the table but i accidentally create a Record.

if [Decription] is table then [Decription]{0} else [Decription]

Click on the Record a get the below:

How i can get the value of the record directly?

Thanks for the help.

enter image description here

UPDATES

  #"Removed Columns4" = Table.RemoveColumns(#"Changed Type2",{"Amount", "Type", "Currency"}),
  #"Transposed Table" = Table.TransformColumns(#"Removed Columns4", {{"Decription", each if Value.Is(_, type table) then _ else #table({"Item"}, {{_}} ) }} ),
  #"ColumnsToExpand" = List.Distinct(List.Combine(List.Transform(Table.Column(Transform, "Decription"), each if _ is table then Table.ColumnNames(_) else {}))),
  #"Expanded" = Table.ExpandTableColumn(Transform, "Decription", ColumnsToExpand, ColumnsToExpand)
  in #"Expanded"`

Error

Expression.Error: The import Transform matches no exports. Did you miss a module reference?

1

There are 1 answers

2
horseyride On

if your data looks similar to

enter image description here

then you can use

#"PriorStepNameHere" = ... ,
Transform=Table.TransformColumns(#"PriorStepNameHere", {{"Description", each if Value.Is(_, type table) then _ else #table({"Item"}, {{_}} ) }} ),
ColumnsToExpand = List.Distinct(List.Combine(List.Transform(Table.Column(Transform, "Description"), each if _ is table then Table.ColumnNames(_) else {}))),
Expanded = Table.ExpandTableColumn(Transform, "Description", ColumnsToExpand, ColumnsToExpand)
in Expanded