Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Santosh_25
Frequent Visitor

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

Hi All,

 

I have a data model and I am facing one issue like we cannot convert a value to type Record to type Table.
Below are the attached images of power query.

Santosh_25_0-1679311741719.png

Santosh_25_1-1679311812680.png

Any help is highly appreciable.

 

Thanks,

Santosh

 

3 REPLIES 3
Santosh_25
Frequent Visitor

Hello,

 

I have connected to json file and source step is record. 

Basically my end result is like whenever the empty results showing that should not throw an error. 

 

Thanks,

Santosh.

Here is how you can check to see if the value is a table and if not, convert it to a table.

Table.TransformColumns(Source, {{"Column1", each if Value.Is(_, type table) then _ else #table({"ExpandTableColumnName"}, {{_}}) }})

Same but for a record...

Table.TransformColumns(Source, {{“Column1”, each if Value.Is(_, type record) then _ else [a=_] }} )

https://www.thebiccountant.com/2017/07/25/how-to-expand-a-column-that-cannot-be-expanded-in-power-bi... 

 

jennratten
Super User
Super User

Hello - is it valid that your source step is a record and not a table?  Do you need to debug that first or are you simply try to convert a record to a table?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors