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
ClaytonMUK
Helper I
Helper I

CSV Data Source Change

Hi,

I've created quite a few visulisations based on a CSV with 17 cols. There was 1 col I didn't need so I just removed it in Query Editor. I also created a few new cols based on merged values from other cols, renamed, change type etc. Now I find my source csv is provided without the superfluous col but when I load that new data file I get an error that the col does not exist.

So, I tried editing via Advanced Editor and removed reference to the unwanted col and changed the number of Columns to 16 but i still get an error "Expression.Error: The import Removed Columns matches no exports. Did you miss a module reference?"

I've tried looking for similar issues and see people have suggested copying the new table in, then changing the name and deleting the original one, but if I do that then I lose the merged cols and all the measures I created.

I'm getting to the stage of starting again with the new csv, but surely there must be a way to re-load a csv with less columns (especially where they are now used!)??

thanks,

1 ACCEPTED SOLUTION

I fixed it 🙂

I realised the next line in Query Editor > Advanced Editor needs to reference the previous line. i.e. (if it helps anyone else..)

I had removed my unwanted line like : #"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"....

The next line still reference it.

#"Inserted Merged Column" = Table.AddColumn(#"Removed Columns", "Merged", ......

 

I changed it so the value matched that from the previous line: (hope that makes sense)

#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{.....
#"Inserted Merged Column" = Table.AddColumn(#"Changed Type", "Merged",.....

 

I guess this can be closed 🙂

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

Can you post the text from Advanced Editor? Can recreate this from that.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

I fixed it 🙂

I realised the next line in Query Editor > Advanced Editor needs to reference the previous line. i.e. (if it helps anyone else..)

I had removed my unwanted line like : #"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"....

The next line still reference it.

#"Inserted Merged Column" = Table.AddColumn(#"Removed Columns", "Merged", ......

 

I changed it so the value matched that from the previous line: (hope that makes sense)

#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{.....
#"Inserted Merged Column" = Table.AddColumn(#"Changed Type", "Merged",.....

 

I guess this can be closed 🙂

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.