Forum Discussion

Element115's avatar
Element115
Memorable Member
3 years ago
Solved

HOW-TO REST API calls + M + refresh in Power BI Service (cloud)

First off, I am writing this up because I would not wish on my worst enemy to go through what I went through just to figure out why the Service refresh would continuously keep emitting this JSON erro...
  • ImkeF's avatar
    3 years ago

    Hi Element115 ,
    agree, that sounds slow.
    I am doing quite a bit with APIs and don't come across such slow loading times (especially for that litte transformation that you do).
    Do you really need to retrieve the token in every every row? 
    Also, I could believe that the addColumn-function slows it down and I cannot see a reason to use it here, so I would refactore that code bit to use the native function instead.
    Using error handlers also slows down the code, so just make sure to only use it where you really need it.
    Also, it could be that due to the complexity of the code, PQ will go and attempt to download the data from the SQL server multiple times. To prohibit that, I would buffer it at this stage:

    remove_cols = Table.Buffer( Table.RemoveColumns( .... )

     

  • ImkeF's avatar
    3 years ago

    Hi Element115 ,
    you do that "outside" of the query editor: Go to "Schedule refresh". There, under "Data source credentials" you can adjust it: