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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Create a empty Table if Table has no values

Hi,

 

I need to fill a empty Table with (empty) values, because my Data Load is based on the month and so it can be empty(with no Columns), but then PowerBI reports an error if I refresh the data.

 

Based on this solution (https://community.powerbi.com/t5/Desktop/Ignore-empty-table-on-load/td-p/254776) I created this query:

 

let
Source = #table(1,{OData.Feed("link"])}),

isEmpty = Table.IsEmpty(Source),


CheckEmpty = if isEmpty=true
then
#table(type table[Column1 = [ColumnNames... ],{})
else
Source,

#"Expanded Column1" = Table.ExpandRecordColumn(CheckEmpty, "Column1",{Columnnames..})
in
#"Expanded Column1"

But if the table isnt empty, I am getting a table full of errors. The Error Message is:

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

 
 
I am really confused, because I have no a idea where the error occurs.
 
Thank you guys.
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

I think this issue should more related to your formula:

let
    Source = #table(1,{OData.Feed("link")}),
    #"Expanded Column1" = if Table.IsEmpty(Source)=true then #table(type table[#"Column1" ,type any],{}) else Table.ExpandRecordColumn(Source, "Column1",{"Columnnames"})
in
    #"Expanded Column1"

 

My test sample:

let
    Source = try OData.Feed("1https://services.odata.org/V3/Northwind/Northwind.svc") otherwise #table(type table[#"ColumnName"=text],{}),
    #"Changed Type" = if Table.IsEmpty(Source)= false then Table.TransformColumnTypes(Source, {{"Name",type any},{"Data",type any},{"Signature",type any}}) else Source
in
    #"Changed Type"

 

Regards,

Xiaoxin Sheng

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous ,

 

I think this issue should more related to your formula:

let
    Source = #table(1,{OData.Feed("link")}),
    #"Expanded Column1" = if Table.IsEmpty(Source)=true then #table(type table[#"Column1" ,type any],{}) else Table.ExpandRecordColumn(Source, "Column1",{"Columnnames"})
in
    #"Expanded Column1"

 

My test sample:

let
    Source = try OData.Feed("1https://services.odata.org/V3/Northwind/Northwind.svc") otherwise #table(type table[#"ColumnName"=text],{}),
    #"Changed Type" = if Table.IsEmpty(Source)= false then Table.TransformColumnTypes(Source, {{"Name",type any},{"Data",type any},{"Signature",type any}}) else Source
in
    #"Changed Type"

 

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.