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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
timahenning2
Helper I
Helper I

PBIP - Getting 'Unable to open document' error when I try to open project

I worked on my project last night saved and closed.  The next day I tried to open the project and received this error prompt:

timahenning2_0-1696082752321.png

It seems like there is a trailing space introduced into a column name and it made its way into my model.  Researching a little I found the Power BI Rest API export to CSV inserts a trailing space for this one field.

CSV

timahenning2_1-1696083133468.png

 

REST API Call

timahenning2_2-1696083276039.png

 

The fix:

Open the BIM model in VS Code and remove the space.

 

timahenning2_3-1696083425154.png

 

This should be fixed.

 

Thanks,

 

Tim 

 

 

2 REPLIES 2
arrows20
New Member

For others facing this issue, worked on small Tabular Editor 2 script to loop through all measures and removes last character if it happens to be whitespace. Saved me a lot of time if anyone needs it

 

foreach(var measure in Model.AllMeasures)
{
    // Check if the measure name ends with a whitespace
    if (measure.Name.EndsWith(" "))
    {
        // Remove the trailing whitespace and update the measure name
        measure.Name = measure.Name.TrimEnd();
    }
}

 

timahenning2
Helper I
Helper I

One solution is to trim the column spaces in Power Query.

timahenning2_0-1696102313567.png

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.