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

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
eliseglines
Frequent Visitor

swapping data source excel file?

Hello,

This seems pretty simple but I keep hitting a wall and am not sure how to fix it. I want to keep all my visuals and graphs the same, but need to swap out the excel file as the data source. Unbeknownst to me, there was an extra column "column 1" in the treatments tab of the initial excel file as well as as column "Employer" in the initial excel file as well. I have tried deleting these from the model as well as deleting them from the original file and refreshing the data from there.

I keep receiving the same error message. Is there a way I can keep the visuals and graphs I've created and swap out the data source with a different excel file from here?

eliseglines_0-1771023796376.png

 

1 ACCEPTED SOLUTION
Murtaza_Ghafoor
Responsive Resident
Responsive Resident

Proposed Solution:

Replace the Source File

New Excel file:

  • Must have the same sheet names
  • Must have same column structure

Apply these steps:

  1. Go to Transform Data
  2. Select the query (for example: Treatments tab)
  3. Click the Source step (on the right under Applied Steps)
  4. Click the (gear icon)
  5. Change the file path to the new Excel file
  6. Click Close & Apply

If this helps, Mark as Kudos | Mark as Solution| Help Others

View solution in original post

6 REPLIES 6
v-aatheeque
Community Support
Community Support

Hi @eliseglines 


Have you had a chance to look through the responses shared earlier? If anything is still unclear, we’ll be happy to provide additional support.

Hi @eliseglines 

Following up to confirm if the earlier responses addressed your query. If not, please share your questions and we’ll assist further.

ralf_anton
Helper II
Helper II

Hi,

 

der Fehlerbeschreibung nach zu urteilen liegt Dein Problem ja nicht in der Änderung der Datenquelle, sondern an den unterschiedlichen Strukturen der abweichenden Datenquellen. Konkret: Unterschiedliche Anzahl von Spalten, abweichende Spaltennamen. Du benötigst deshalb eine Liste aller zulässigen Spaltennamen und eine der vorhandenen Spaltennamen der aktuellen Datenquelle. 

Jetzt gibt es wieder 2 Möglicheiten. Die aktuelle Datenquelle enthält entweder alle zulässigen Spaltennamen, dann kannst die alle anderen Spalten, die nicht in der Liste enthalten sind löschen, oder die aktuelle Datenquelle enthält nur einige oder keinen zulässigen Spaltennamen (Beispiel: Umsatz2024 statt Umsatz2025), dann müssen die Spaltennamen vorher angepasst werden. Also Umsatz2024 zu Umsatz2025. 

Da wir aber die konkrete Situation nicht kennen, kannst Du nur eine pauschale Antwort erhalten.

Hier ein Beispiel für die dynamische Um- und Rückbennung von Spalten unterschiedlicher Namen und Anzahl:

let
    Quelle = Excel.CurrentWorkbook(){[Name="tblBestellungen"]}[Content],

    Alt = Table.ColumnNames(Quelle),                                                            //Liste der ursprünglichen Spaltennamen
   
    NurPassende = {Character.FromNumber(65)..Character.FromNumber(65 + List.Count(Alt)-1)},     //Liste der alternativen Spaltennamen
    
    PaareNeu = List.Zip({Alt,NurPassende}),                                         //Liste von Paaren Alt/NurPassende für die Umbenennung
    PaareAlt  = List.Zip({NurPassende,Alt}),                                        //Liste von Paaren NurPassende/Alt für die Rückbenennung
    Umbenennen = Table.RenameColumns(Quelle,PaareNeu,MissingField.Ignore),          //Den Spalten die neuen Überschriften verpassen

    RenameBack =   Table.RenameColumns(Umbenennen,PaareAlt,MissingField.Ignore)     //UNd jetzt die alten Überschriften wieder verwenden
in
    RenameBack

 

Murtaza_Ghafoor
Responsive Resident
Responsive Resident

Proposed Solution:

Replace the Source File

New Excel file:

  • Must have the same sheet names
  • Must have same column structure

Apply these steps:

  1. Go to Transform Data
  2. Select the query (for example: Treatments tab)
  3. Click the Source step (on the right under Applied Steps)
  4. Click the (gear icon)
  5. Change the file path to the new Excel file
  6. Click Close & Apply

If this helps, Mark as Kudos | Mark as Solution| Help Others

Riny_vE
Helper I
Helper I

You need to edit the queries that connect to the data and delete any reference that they have to these 'missing' columns. Most likely you'll find them in steps that change data types or delete columns. Can't tell without seeing the M-code.

cengizhanarslan
Super User
Super User

Instead of deleting those column sın Power BI, try Refresh data and schema under Refresh option. If you already added delete columns step in Power Query, you would need to delete those steps first.

_________________________________________________________
If this helped, ✓ Mark as Solution | Kudos appreciated
Connect on LinkedIn | Follow on Medium
AI-assisted tools are used solely for wording support. All conclusions are independently reviewed.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

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.