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
Shreyas1902
Frequent Visitor

Creating A Power BI App – missing fields

Hi –

 

We are trying to create a Power BI Template App that will work for many users.  The sample data set we have has a number of custom fields so that the sample reports demonstrate many great visuals.  However, not all users of the App will have those fields.  We recognize that some visuals using the custom fields will be broken, but that should not be an issue.

 

In our testing of the App, when we connect to a new data source that does not have all fields, the refresh fails with error:

 

Processing error The column 'XXXX' of the table wasn't found.” 

 

Is there a way to configure a Template App so that it ignores missing fields?

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

HI @Shreyas1902,

Perhaps you can try to manually define a table template to initialization, then you can load correspond table records from the response table to the template.

Chris Webb's BI Blog: Creating Tables In Power BI/Power Query M Code Using #table() Chris Webb's BI ...

Sample code: 

Custom1 = Table.Combine({Source,#table(type table[A,B,C,D,E],{})}

Source table:

4.png

Result:

5.png

Notice:

1. The right one is the template table with all fields.

2. ' Table.combine' function will add all the fields to the result table, the columns that do not exist in the raw table will be filled with null values.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

HI @Shreyas1902,

Perhaps you can try to manually define a table template to initialization, then you can load correspond table records from the response table to the template.

Chris Webb's BI Blog: Creating Tables In Power BI/Power Query M Code Using #table() Chris Webb's BI ...

Sample code: 

Custom1 = Table.Combine({Source,#table(type table[A,B,C,D,E],{})}

Source table:

4.png

Result:

5.png

Notice:

1. The right one is the template table with all fields.

2. ' Table.combine' function will add all the fields to the result table, the columns that do not exist in the raw table will be filled with null values.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
lbendlin
Super User
Super User

Append a question mark to the column name selector when you manipulate it in Power Query.  Instead of 

 

[Column a] + [Column b] 

 

you can write (assuming that column b is sometimes missing)

 

[Column a] + [Column b]?

 

That will yield null if the column is missing.

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.