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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
InsightDriven11
New Member

Problem with Power Query refresh in Power BI Service (httpStatus :500)

Hello everyone,

 

I’m getting this error message when I refresh Power Query via the Service:

Underlying error: PowerBI service client received error HTTP response.
HttpStatus: 500
PowerBIErrorCode: ExternalServiceFailed

I created a function that retrieves data from 20 different databases:

 

(Base as text,   requete as text) as table =>
let
    Source =
        try
            Sql.Database(
                serveur,
                Base,
                [
                   
                        Query=
                         query
                ]
            )
        otherwise
            #table({}, {}),

    AddBase = Table.AddColumn(Source, "SourceBase", each Base)
in
    AddBase

 

Then I call this function to build a query that concatenates the data into a single table:

 

let
    BasesActives = Table.SelectRows(Database_table, each [Active] = "1"  ),

    AddData = Table.AddColumn(
        BasesActives,
        "Data",
        each getTableSQL(
            [BaseName],
             
            "select CG_num  from dbo.F_ECRITUREC"
        )
    ),
    Combine = Table.Combine(AddData[Data])
in
    Combine
 

I’m able to preview the data and everything looks fine. However, the data does not load when I try to save/publish (and i have the error 500, that we can see above..) 

I tested the same query on a single database without using the function, and the data loads correctly.

Has anyone experienced the same issue? any idea to solve it ?

 

Thanks a lot, 

 

Martin 

 

 

3 REPLIES 3
v-prasare
Community Support
Community Support

Hi @InsightDriven11,

We would like to confirm if our community members answer resolves your query or if you need further help. If you still have any questions or need more support, please feel free to let us know. We are happy to help you.

 

 

 

Thank you for your patience and look forward to hearing from you.
Best Regards,
Prashanth Are
MS Fabric community support

InsightDriven11
New Member

Hi, 

 

Thank you for your answer ! 

I tested the code above, with only 1 database in Database_table

The display is perfectly working, but the load not.

 

In addition, i'm not working in Fabric, but in Power BI Service.

AjiteshChurewal
Regular Visitor

Hi,

Since the data loads successfully for a single database but fails when running for 20 databases, this could be a timeout issue. How much time does it take to extract data from one database?

I suggest trying the following:

  1. Gradually increase the number of databases one at a time (i.e., first run for 1 database, then 2, and so on) and identify the point of failure — specifically, after how many databases the error starts occurring. This could indicate two possibilities:

    • The error is a timeout issue (in which case, proceed to step 2).

    • There is an issue fetching data from a particular database. To rule this out, try running the process only for that specific database. If it runs successfully, then this is not the cause, and you can proceed to step 2.

  2. Create separate dataflows for each database (resulting in 20 dataflows). Then use these dataflows as sources, merge them into a single dataflow, and use that for reporting. If you are using Fabric capacity, use Dataflow Gen2; otherwise, use Dataflow Gen1.

_________________________________________________________
If this helped, ✓ Mark as Solution | Kudos appreciated

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.