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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
DMCUK-London-21
New Member

Table.ReplaceValue - Refresh Data - Potential Missing Columns

Hi All

 

I hope everybody is safe and well?

 

I have quick question why I am hoping people will be able to answer. 

 

I currently have a ReplaceValue set on a query for a Datasource. The purpose of this is to replace the word of null with 0. Essentially the Datasource will have a list of weeks in columns where this needs to be replaced.

 

Table.ReplaceValue(#"Changed Type",null,0,Replacer.ReplaceValue,{"Week 1", "Week 2", "Week 3", etc})

 

The issue I have got is that if a column is missing on the data source I would get the error:

 

Expression.Error: The column 'Week 69' of the table wasn't found. Details: Week 69.

 

How can I get around this error, if I know that there is the potential to have other columns missing on different data refreshes.

 

Please let me know also if there is a better way to do this?

 

Kind Regards

 

 

 

1 REPLY 1
HotChilli
Super User
Super User

Looks like you should be unpivotting those week columns.  Should make everything a bit easier.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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