Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
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:
Any help, much appreciated.
Thanks
Solved! Go to Solution.
Hi @JohnLow ,
Please refer to the following steps, hope it helps.
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
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
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.
Hi @JohnLow ,
Please refer to the following steps, hope it helps.
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
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
24 | |
13 | |
12 | |
11 | |
8 |
User | Count |
---|---|
43 | |
26 | |
16 | |
15 | |
12 |