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
Anonymous
Not applicable

How to remove intermittent blanks from a CSV import, without removing data in adjacent columns?

Hi all,

 

I'm importing a CSV which contains intermittent blanks in some columns, which don't align with blanks in other columns. Therefore in Power Query, if I remove blanks in one column it will 'remove' data in an adjacent column:

1.PNG

So in the picture above, if I removed blanks 1 and 2, I'd also lose the values in 1.2 and 1.3.

 

Any suggestions as to how I could remove blanks and retain adjacent values?

 

Thanks in advance

 

 

7 REPLIES 7
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Create a new blank query, 

copy the source file path and paste here, 

keep only "cl2" column, 

remove blank row for "cl2" column,

add an index column from 1

Capture3.JPG

 

in Table, remove "cl2" column, 

add an index column from 1,

merge queries, expand "cl2" column

Capture2.JPGCapture4.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Create a new blank query

Capture3.JPG

copy source file path from "Table" and paste here,

then remove other columns, only keep "cl2",

remove blank rows for "cl2" column,

add index column from 1

 

Then in "Table", 

remove "cl2" column,

add index column from 1

merge queries

Capture4.JPG

 

expand "cl2" column

Capture4.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Ashish_Mathur
Super User
Super User

Hi,

I suggest that you plug in the blank cells with the value appearing from above.  Right click on the second column's heading and select Fill > Down.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi, thanks for that suggestion - I probably should have mentioned that I want to put this information in a table, so don't want duplicates showing.

Hi,

When you drag column 2 to a Table visual, you will only see unique entries.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Yes, with gaps in there when done with columns 1 and 3. I'm trying to create a table with no gaps between fields

Hi,

Once you fill the gaps in column 2 (as described above) and drag that column to the visual, you will not face any problem.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.