Forum Discussion
missing columns when trying to expand json files on PowerBI service
- 6 years ago
I have done a test.
First I placed the data source in my local laptop
A. On power BI service, create dataflow > select folder > get the json files and expand all the columns
B. On power BI desktop, get data from folder > get the json files and expand all the columns
Then I compared the M query of A with that of B.
Interestingly I found some columns were missing in A, when a nested document contains more than 2 nested documents the 3rd document were missing and therefore further atrributes in this missing nested document was unable to further expand.
As a result, I developed my best practise when dealing with json files
It does not matter where the data source is, but
1. always try to transform the data via PBI desktop, this is much faster and accurate. Very important => always check "use original column name as prefix" (I usually uncheck this box as this makes the field name so long. However I attained errors when paste the M query to PBI service. then I start all over again to check that box whenever expanding columns. in the end I renamed all the attribute names. I found no errors when pasting the M query to PBI service)
2. then copy the M query from advanced editor
3. go to PBI service, create dataflow, select the method you want to connect the data source
4. once connected, go to the advanced editor, paste the M query to the right place
5. save and close 🙂
ibarrau Thank for hints provided here so that I finally work this out.
Thank the community here very responsive and professional.