Forum Discussion

alexeisenhart's avatar
alexeisenhart
Resolver I
2 years ago
Solved

Unable to open document - Multiple columns referencing a single source column

I have a large PBIX that I've been working on. The Desktop program was starting to feel a little glitchy -- changing a column's data type from Date/Time to Date was not removing the Time portion of t...
  • alexeisenhart's avatar
    2 years ago

    Thanks vanessafvg for the idea! It didn't pan out -- the model file complained of the the same issue, and the report file had some other weird error reported. But you got me thinking.

     

    I found a solution. I'm documenting it here as fully as I can so that it can help someone (maybe me!) in the future.

     

    I downloaded the latest version of PBI Tools. https://pbi.tools/ and hoped that it would read the file -- it DID! I used this command to dump the contents of the PBIX to a folder:

     

    pbi-tools.exe extract "My Power BI file name.pbix"

     

    Then I found the dataset that had the issue with 2 relationships from one table, and deleted one of the columns.  I opened the correct .tmd file in the tables folder, found the lines that described that column and deleted it. Here's what I actually changed:

     

    	measure 'Project Status - Latest Description' =
    		
    		
    		// CODE HERE
    		lineageTag: b59ee9b3-a0f7-4725-a86c-91a9114896ec
    
    	column regardingobjectid
    		dataType: String
    		isDataTypeInferred: false
    		lineageTag: 2d6329c3-3c56-40c3-9c38-faf69a0758c0
    		sourceColumn: "Software Project ID"
    		summarizeBy: None
    
    		annotation SummarizationSetBy = Automatic
    
    	column id
    		dataType: String
    		isDataTypeInferred: false
    		lineageTag: 9423b262-4d9d-4a03-9570-354c0cb47c5a
    		sourceColumn: id
    		summarizeBy: None
    
    		annotation SummarizationSetBy = Automatic

     

    I deleted everything from "column regardingobjectid" through "annotation SummarizeSetBy = Automatic" and also the empty lines, to preseve the formatting pattern. I saved the file and then ran this command:

     

    pbi-tools.exe compile "My Power BI File Name Here" -format PBIT -outPath test.pbit

     

    This command used the dump folder, which I modified, and built a PBIT from that file. I opened the PBIT and Power BI loaded and started to refresh the data. It failed because of the issues I just created with that dataset, but I was able to jump into Transform Tools and adjust the column names.

     

    Issue Summary:

     

    IDK how it happened, but somehow two columns had similar names and they both were trying to be used for one relationship to another table. This caused all sorts of weird runtime issues with Power BI Desktop. I saved the file and tried to re-load it, but the error prevent the file from opening. Tabular Editor would not open the file, because it was a PBIX.

     

    Resolution:

    I used PBI-Tools to create a dump of the contents of the PBIX, modified that extract, and rebuilt a PBIT that had more easily-fixable errors that Power BI Desktop was able to load. Fixed the original issue via Transform tools and hit Refresh.

     

    Profit.