Forum Discussion
How does Dataflow gen2 handles flat (txt) files
- 1 year ago
Hi junminn30
In Lakehouse, you will not see blank rows becuase it's has limitation (show upto 1000 rows). I replicated your scenario.
Lets's say I have a txt file(this i uploaded from my machine into dataflow gen2) called Sales_Fabric with column called SalesOrderLinenumber having blanksLater I published this into my Sample_LH lakehouse. At that I'm able to see like this. Assume that I'm not able to see blank rows.
But if i query the table in SQL analytics end point, It clearly showing blanks in SalesOrderLinenumber column
I think it's sorting in differet way in the lakehouse.
Hope you are clear now. Let me know if it works
Thank you!!
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
Hi junminn30 ,
Handling flat .txt files in Dataflow Gen2 can be a bit tricky, especially when dealing with blank rows, headers, or footers.
Here are a few clarifications and suggestions:
🔍 Why Blank Rows Might Disappear
When you publish your Dataflow Gen2 output to a Lakehouse table, the system automatically applies schema inference and optimization, which may exclude rows that appear empty or don't match the inferred schema. This is especially true if:
- The blank rows contain no data or only whitespace.
- The file has inconsistent row structures (e.g., footers or headers mid-file).
Also, the Lakehouse UI preview is limited to 1,000 rows and may not show all data. To verify, try querying the table using the SQL Analytics Endpoint—you might find the missing rows are actually there.
✅ Recommendations
Explicitly Handle Blank Rows in Power Query
In your Dataflow Gen2, add a step to preserve or flag blank rows before publishing. For example:- Add a conditional column to detect empty rows.
- Replace nulls with placeholders if needed.
Use a Notebook for More Control
If you need precise control over how rows are interpreted (e.g., skipping footers, preserving blanks), consider using a Fabric Notebook with PySpark to read and process the .txt file before writing to the Lakehouse.Check File Encoding and Delimiters
Ensure the file encoding (e.g., UTF-8) and delimiters are correctly interpreted by the Dataflow. Misinterpretation can lead to row loss or misalignment.
Let me know if you'd like a sample Power Query or notebook script to handle this more robustly!
- junminn301 year agoRegular Visitor
Thank you so much. I've been quite busy with other projects and didn't have the time to respond. I will try and get back to this message if I face any problems.