-
Notifications
You must be signed in to change notification settings - Fork 252
Error saving .pbit file - encoding/decoding of json #263
Description
Hi guys
Great tool and have been gaining so much more efficiency managing 150+ measures in a current Power Bi project Vs the tedious and laggy editing in Power Bi Desktop... just wasn't efficient at all in desktop !
First off I fully acknowledged the risks of file corruption. So when I encountered the following issue I was somewhat prepared and have recovered. All good. But thought it would be worth posting the issue.
While adding a series of new measures in a .pbit file that was converted from a .pbix, all was going smoothly for some time.
Then somewhere along the line after saving the pbit file and closing it was not able to be opened the next time.
It gives me the following error " Error loading model from disc - "this file is not a valid PBIX/PBIT file".
hmmm ...
On investigation of the file I was able to open the .pbit file in a text editor and found that it contained json of many things such as table/model definitions but of interest to me it included all of my new dax measures. The file size was 2000kb vs 700kb which was my clue to investigate.
for example it began with
{
"name": "dfe0355f-aac6-43df-928f-3f0a1b7af881",
"compatibilityLevel": 1465,
"createdTimestamp": "2019-02-26T12:02:07.81+11:00",
"lastUpdate": "2019-02-28T09:29:24.783333+11:00",
"lastSchemaUpdate": "2019-02-26T12:02:07.81+11:00",
"lastProcessed": "2019-02-28T08:57:34.016667+11:00",
"model": {
"culture": "en-US",
"modifiedTime": "2019-02-26T01:02:08.553333",
"structureModifiedTime": "2019-02-27T21:56:51.806667",
"dataSources": [
On comparison to the previous versions of the same .pbi file I saw that these were NOT directly editable in a text editor and appeared to be a compressed format and un-recognisable.
If I can provide any system setup details that might help debug let me know.
So long story short I was able to identify the new measures in the json objects in the "corrupted" .pbit file and transfer to a new working copy. So I'm 95% back on track and happy.
But some issues/questions are :
- Is the json output created by some tabular editor setting ? I can't seem to find an option for this ?
- It was very helpful in other ways as it turns out and has go me thinking about xslt or json driven code generation for parametric inputs....or just simple github code managment..... another conversation there.
- is there a way to convert the json based .pbit back to a useable "encoded" format ? While I recovered the measures I did loose a few other pieces of work that I won't be able to recover easily manually. So it would be great to recover it still.
Noting other git issues posted here, I was saving the already open .pbit file as different versions along the way. But this appeared to work.
I may have put the PC to sleep in between the save event. Though can't be sure.
Many thanks in advance !
Simon