cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
JohnLow
Helper I
Helper I

Cannot convert a value of type Record to type Text.

Hi,

 

I'm currently trying to extract values from a list column, called data.custom_fields which has 9 records. However I'm getting the following error message:

 

Expression.Error: We cannot convert a value of type Record to type Text.


Details:
Value=
compulsory_on_complete=FALSE
name=Staff Member
value=
value_id=
type=choice
id=1
visible_to_staff_only=TRUE
Type=[Type]

 

My M Code is as follows:

 

2023-05-30_09h25_50.png

2023-05-30_09h25_50.png

Any help, much appreciated.

 

Thanks

1 ACCEPTED SOLUTION

Hi @JohnLow ,

 

Please refer to the following steps, hope it helps.

vcgaomsft_0-1685608879522.png

vcgaomsft_1-1685608897242.png

let
    Source = #table({"aa","bb"},{{1,{1,2,3}},{2,{33,44}}}),
    Custom1 = Table.TransformColumns(Source,{"bb", each Record.FromList(_,{"1"..Text.From(List.Count(_))})}),
    #"Expanded bb" = Table.ExpandRecordColumn(Custom1, "bb", {"1", "2", "3"}, {"1", "2", "3"})
in
    #"Expanded bb"

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

3 REPLIES 3
ppm1
Solution Sage
Solution Sage

The Text.Combine function in your last step expects a list an the input, but it looks like you have expanded a list of records. You should be able to expand that column of [Record] values. Have you tried that (instead of using Text.Combine)?

 

Pat

Microsoft Employee

Yes, but if I expand this, it give me 9 rows for each record and I would like 9 columns instead. Just not sure how to do that.

 

 New_ad_find.png

Hi @JohnLow ,

 

Please refer to the following steps, hope it helps.

vcgaomsft_0-1685608879522.png

vcgaomsft_1-1685608897242.png

let
    Source = #table({"aa","bb"},{{1,{1,2,3}},{2,{33,44}}}),
    Custom1 = Table.TransformColumns(Source,{"bb", each Record.FromList(_,{"1"..Text.From(List.Count(_))})}),
    #"Expanded bb" = Table.ExpandRecordColumn(Custom1, "bb", {"1", "2", "3"}, {"1", "2", "3"})
in
    #"Expanded bb"

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors