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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
arcegabriel
Helper I
Helper I

Detecting sources files with missing fields

Looking for some help from the experts

I have a power query that pulls files on Sharepoint. It will pull out a particular table on them

The tables are supposed to be the same but not always are. 

Say most files have fields A, B, C, D, E (the sample file as well)

And then there is one file incorrect.xlsx with fields A, B, C, D, Z

 

I woould like to have a way to identify any such a file. I figured that when I run the query, it just shows for the incorrect.xlsx including the fields A, B, C, D, E and E is empty

 

Is there any way to detect this incorrect.xlsx?

5 REPLIES 5
arcegabriel
Helper I
Helper I

Hi,

Thanks for trying this out. The question is that in your example. These two result on teh same:

1. If the column is missing in exce2.csv it will show in end result as "null" (what you did)

2.  if the column exist but has no values in exce2.csv it will ALSO show in end result as "null" 

 

My question was whether there is a way to different case #1 vs #2

Syndicate_Admin
Administrator
Administrator

Hi @arcegabriel ,

 

As shown in the figure below, there is a incorrect field column in EXCEL2.CSV. The fields in excel1.xlsx are all correct, then when you combine files, select excel1.xlsx as the object template to combine.

1.png

4.png

 

Please see the introduction in the underlined section, select the object to be extracted from each file.

5.png

 

The result is as follows, the incorrect field is not extracted.

6.png

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

Hi @arcegabriel ,

 

As shown in the figure below, there is a incorrect field column in EXCEL2.CSV. The fields in excel1.xlsx are all correct, then when you combine files, select excel1.xlsx as the object template to combine.

1.png

4.png

 

Please see the introduction in the underlined section, select the object to be extracted from each file.

5.png

 

The result is as follows, the incorrect field is not extracted.

6.png

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

CNENFRNL
Community Champion
Community Champion

= List.ContainsAll( Table.ColumnNames( xxxtable ), {"colA","colB","colC"} )

test if column names of a table contain all of {"colA","colB","colC"}


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Thanks bu that is not addressing my question. The problem is when you combine source files and a sample file is used as a sample (example https://docs.microsoft.com/en-us/power-bi/transform-model/desktop-combine-binaries)

In that case all files are read using the sample file structure with the results I described on the OP

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors