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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jofujofu
Frequent Visitor

Looping throu REST-API to get all JSON content / Error during saving in PowerQuery

Hi,

I am searching for a simple solution to loop throu a website-content API to get all Records...

Fond a simple way by the use of a function: 

 

(Skip_It as number) as table => 
let
Quelle1 = Web.Contents("https://URL-DELETED?skip=" & Number.ToText(Skip_It)),
Quelle = Json.Document(Quelle1),
data = Quelle[data],
#"In Tabelle konvertiert" = Table.FromList(data, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Erweiterte Column1" = Table.ExpandRecordColumn(#"In Tabelle konvertiert", "Column1", {"_id", "_type", "city", "email", "geoLat", "geoLng", "isXSLocation", "mainCategoryUid", "name", "phone", "postalCode", "street", "uid", "website"}, {"Column1._id", "Column1._type", "Column1.city", "Column1.email", "Column1.geoLat", "Column1.geoLng", "Column1.isXSLocation", "Column1.mainCategoryUid", "Column1.name", "Column1.phone", "Column1.postalCode", "Column1.street", "Column1.uid", "Column1.website"})
in
#"Erweiterte Column1"

 This funtion works well with a table by skipping record-numbers für the API Call

 

BUT: when i want do close/save the PowerQuery Editor i get an strange error:

"Der Ausdruck in der Partition "n/a" in Tabelle "n/a" verweist auf eine unbekannte Entität."

meaning there is a partition in an unknown table for an unknown entity???

 

What did i do wrong in den funtion? Did not found anything wrong here, no syntax error....???

 

Thanks for a hint!

Josef

 
1 ACCEPTED SOLUTION

Hi, @ImkeF  - thanks for the link!

 

TURNING the "enhanced metadata format" OFF and restart PowerBI WITH an NEW file (ans copyying evry formular via windows editor solved this problem!

 

Thanks Josef

View solution in original post

5 REPLIES 5
ImkeF
Super User
Super User

Hi @jofujofu  

that looks really strange. Hard to see that the function is actually the reason for it. 

Could it be a problem in the query instead that you're calling the function from?

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Hi Imke,

 

the query deliveres the rights results. Also the function workes fine, when Triggered manually (step by step codeing in the enhenced editor in PowerBI... After Saveing I always receives this Error (didnt found the english equivalent!):

 

Zurückgegebener Fehler: "Der Ausdruck in der Partition "n/a" in Tabelle "n/a" verweist auf eine unbekannte Entität. ".

 

Must have to do with the transformation from the API Call (Website-API / no uid/pw) to the JSON and furthermore to the Table. It's a simple Web Call....

???

Any hints?

Josef

Hi @jofujofu 

do you have the "Store datasets in enhanced metadata format" turned on?

 

I've had the same error when copy pasting a working set of queries into a new file with the preview feature "Store datasets in enhanced metadata format" turned on. It seems to be a bug that others are experiencing as well, unfortunately:

https://community.powerbi.com/t5/Issues/Error-on-apply-Power-Query-Expression-in-partition-n-a-in-ta...

 

 

 

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Hi, @ImkeF  - thanks for the link!

 

TURNING the "enhanced metadata format" OFF and restart PowerBI WITH an NEW file (ans copyying evry formular via windows editor solved this problem!

 

Thanks Josef

Greg_Deckler
Super User
Super User

@ImkeF

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors