Forum Discussion

shafiz_rn's avatar
shafiz_rn
Regular Visitor
2 months ago
Solved

how to appened multiple server query and implement incremental refresh in power bi

Hi,

I have multiple server in different locaiton. The task is I need to connect to all the server and create an master query by appending. To get data, each location there are seperate gateway installed.

But I don't find any suitable way to append those queries and implement incremental refresh. If you have any idea how to do it properly??

Otherwise, i need to implement incremental refresh one each query and report seperate. I don't know is it a good idea or not. For cross region report, we could use dax but will it be efficient or scalable??

Also, does refresh take much longer if implement incremental refresh on individual query?? each query refresh window is 1 month, say, 200K to much 400K.

What i have: I have only PPU license.

Thanks,
Shahariar Hafiz

  • Thanks ShahRukhSameer​ , Praful_Potphode​ PauReis​ for your kind suggestion. 

    After discussing different approaches, several possible solutions emerged till now:

    • Dataflow Gen1 (if you don't mind using a deprecated feature). Incremental refresh is possible.
    • Dataflow Gen2 (requires Microsoft Fabric capacity).
    • Composite Models (combining multiple semantic models | Mode must be direct).
    • Multiple Gateways (one per region).

    I need to provide a single report to Sales Managers who are responsible for multiple regions.

    My constraints were:

    • No central database or data warehouse.
    • No Microsoft Fabric capacity.
    • I don't want to use Dataflow Gen1 because it is being deprecated.
    • The report needs to be shared broadly (Need Publish To Web, Security Considered).

    The main problem was combining data from multiple regional sources while still supporting Incremental Refresh.

    A common approach would be to use Power Query Append, but this can break query folding. Once query folding is broken, Incremental Refresh will not work. Also, in Power BI service, you can configure and map only one gateway at a time.

    Fortunately, from one gateway I can reach to all the location. I was not aware of this before. I don't need multiple gateway. This eliminated the need for multiple gateways entirely.

    Recommended Approach (If you can reach all location from one gateway)

    • Create a separate query for each regional data source.
    • Ensure query folding is preserved on each query.
    • Load each regional table into the model.
    • Configure Incremental Refresh on each table individually.
    • Create a DAX calculated table that unions all regional tables.
    • Hide the individual regional tables from report view and use only the combined table.
    • Publish the dataset and report to Power BI Service.
    • Configure and map all source connections through that gateway.
    • Refresh and validate Incremental Refresh behavior.

     

    Important Note:
    The critical point is that the UNION should happen in the semantic model using DAX, not in Power Query.

    If you can not reach to all the location from one gateway, then one region one gateway in one report.

15 Replies

  • Hi shafiz_rn,

     

    I’ve run into this challenge before when dealing with multiple servers behind different gateways. The tricky part is that incremental refresh only works cleanly when query folding is preserved, and once you append queries from different sources, folding usually breaks. That’s why you’re not finding a “native” way to do it in one master query.

    The more reliable approach is to set up incremental refresh separately on each source query. Each server will then only refresh the new/changed data, which keeps things efficient. After that, you can combine the results at the model level (using DAX or composite models) rather than trying to union everything first. It’s generally more scalable than forcing one giant append.

     

    If you want a cleaner architecture, consider staging the data in dataflows (or Fabric Lakehouse if you have access). Each server pushes into its own dataflow with incremental refresh, and then you append those dataflows into a master dataset. That way the heavy lifting happens upstream, and your report only deals with already‑optimized tables.

     

    On refresh times: with 200K–400K rows per month, incremental refresh should help a lot, but only if the filter logic folds back to the source. If folding breaks, Power BI will pull everything and filter locally, which is slow. So the key is to keep folding intact per source.

     

    Since you’re on PPU, you can definitely use incremental refresh, but I’d recommend doing it per source (or via dataflows) rather than trying to append first. For cross‑region reporting, combining at the semantic layer with DAX is fine and usually more efficient.

    • shafiz_rn's avatar
      shafiz_rn
      Regular Visitor

      Separate incremental refresh on each source is likely the last practical option. I can't build the architecture around Dataflow Gen1 because it's effectively in a legacy state and I don't want to introduce a dependency on a technology that may be phased out in the future. Dataflow Gen2 would be a better fit architecturally, but it requires Fabric capacity, which I don't have. I am also not fully convinced about the long term maintainability and scalability of a composite model approach. While it works for the current requirement, it could become difficult to manage as the solution grows.

      Initial: Total Sales = Sum(A) + Sum(B) but if new region need to add in future then I can't imagine.

      • ShahRukhSameer's avatar
        ShahRukhSameer
        Icon for Solution Sage rankSolution Sage

        Hi shafiz_rn,

         

        I hear you — Dataflow Gen1 is basically legacy now, and without Fabric capacity Gen2 isn’t an option, so separate incremental refresh per source really is the most practical route. It keeps folding intact at each gateway and avoids the complexity of trying to union everything first.

         

        On the composite model point: you’re right that it works for the current requirement but can get messy as the number of sources grows. The way to keep it maintainable is to push as much logic as possible into measures rather than hard‑coding sums. For example, instead of writing something like:

        Total Sales = SUM(A) + SUM(B)

         

        you’d want a structure that scales when new regions are added. A simple pattern is:

        Total Sales = SUM(FactSales[SalesAmount])

         

        where FactSales already contains all regions. If you’re pulling from separate queries, you can normalize them into one fact table (either via dataflows or staging queries) so you don’t have to rewrite the measure every time a new region comes in.

         

        If staging isn’t possible, then yes — incremental refresh per source plus a semantic layer that combines them is the safest option. It may feel like extra work now, but it’s much easier to maintain than constantly editing measures when new regions appear.

  • Hi shafiz_rn 

    it is possible and manageable if done properly.By Server i assume you are talking about different environments

    follow below steps to make sure incremental refresh work properly.

    1. Create Parameters to store All Server,database and schema.
    2. Create a UNION ALL query combining all server queries.
    3. use the query in PowerQuery and parameterize the query using parameters created in step 1.
    4. Make sure query is folding after step3.
    5. Create RangeStart and RangeEnd Parameters and apply filter on date column.
    6. Configure Incremental refresh policy.

    If your Servers are CLoud based then there is no need of gateway for them.

    if the setup is configured correctly the first refresh will take time as it will create and load all partitions.but subsequent refreshes will be faster.

     

    Please give kudos or mark it as solution once confirmed.

     

    Thanks and Regards,

    Praful

     

     

    • shafiz_rn's avatar
      shafiz_rn
      Regular Visitor

      Thanks for the suggestion. I think there may be a difference between the architecture you're describing and my current environment.

       

      My data sources are hosted on separate on-premises SQL Servers located at different region, each with its own on-premises data gateway. There is no central SQL Server, linked-server setup, or Fabric/Dataflow layer between them.

       

      Because of that, I'm not sure how a UNION ALL query across all servers would be executed while still preserving query folding. My understanding is that Power Query can usually fold to a single source, but once data is combined from multiple independent SQL Servers through different gateways, folding breaks.

       

      Could you clarify where you expect the UNION ALL to run? Are you assuming:

      A central SQL Server?
      Linked Servers?
      Multiple databases on the same SQL instance?

       

      In my case, each region has its own SQL Server and gateway, so I'm currently leaning toward keeping incremental refresh configured separately on each region dataset. Only problem is cross region report.

  • shafiz_rn Two constraints in your post decide most of this, and they are worth separating before you commit to an architecture.

     

    The first is the gateways, and it is the harder one. The gateway documentation is direct: "If your dataset contains multiple data sources, add each one to the gateway. If a data source isn't added, you don't see the gateway as available for scheduled refresh." The practical consequence is that whichever gateway you pick has to be able to reach every on-premises source in that model. Appending the queries in Power Query does not change that, because the append happens after the data has been fetched, and each fetch still has to go through a gateway that can see that server. Clustering does not rescue it either. A cluster is for availability, any member can take a request, so a member that cannot reach one of your servers simply fails when a request for it lands there.

     

    The second is the licence, and it rules out half of the advice above. You said PPU only. Premium Per User does not provision a Fabric capacity and does not let you create or run non-Power BI Fabric items such as lakehouses, warehouses or notebooks, so the Lakehouse route is not open to you. Dataflows are, and this is one of the few places where Microsoft's own guidance names your exact licence: for a shared source it recommends a Dataflow Gen2, "or a dataflow (legacy) for Pro/PPU users without Fabric access".

     

    So the shape I would build is one Gen1 dataflow per location, each in a Premium workspace, each refreshing through its own local gateway, each with its own incremental refresh. Then a single semantic model that reads those dataflows and appends them there. At that point the append is between cloud sources and the gateway problem disappears completely, and each region refreshes independently instead of one unreachable server taking down the whole load. Two documented details that make it work on your licence: a Pro or PPU user can create a dataflow in a Premium workspace, and dataflow incremental refresh is a Premium feature, which a PPU workspace satisfies.

     

    On your direct questions.

     

    Incremental refresh per query is not slower, it is the reason the thing gets fast. Only the partitions inside the refresh window are queried, so a one month window over 200K to 400K rows is a small read no matter how many years of history you are storing. The one that genuinely hurts is the very first refresh, which loads the entire store period in one go.

     

    DAX at the model level for the cross-region reporting is fine, and it is not where your cost is. Combining at the model rather than in Power Query is the normal answer whenever sources cannot be folded together anyway.

     

    One trap to check on every single branch before you publish, because it produces duplicate rows quietly instead of an error: "Verify queries have an equal to (=) on either RangeStart or RangeEnd, but not both. If the equal to (=) exists on both parameters, a row could satisfy the conditions for two partitions." With one query per server that is a check you have to do several times over, and each one is its own opportunity to get it wrong.

     

    Before any of that though: are those servers genuinely unreachable from one machine, or did each location just install its own gateway because that was the path of least resistance at the time? If one gateway can see all of them, most of this problem goes away.

  • shafiz_rn's avatar
    shafiz_rn
    Regular Visitor

    Thanks ShahRukhSameer​ , Praful_Potphode​ PauReis​ for your kind suggestion. 

    After discussing different approaches, several possible solutions emerged till now:

    • Dataflow Gen1 (if you don't mind using a deprecated feature). Incremental refresh is possible.
    • Dataflow Gen2 (requires Microsoft Fabric capacity).
    • Composite Models (combining multiple semantic models | Mode must be direct).
    • Multiple Gateways (one per region).

    I need to provide a single report to Sales Managers who are responsible for multiple regions.

    My constraints were:

    • No central database or data warehouse.
    • No Microsoft Fabric capacity.
    • I don't want to use Dataflow Gen1 because it is being deprecated.
    • The report needs to be shared broadly (Need Publish To Web, Security Considered).

    The main problem was combining data from multiple regional sources while still supporting Incremental Refresh.

    A common approach would be to use Power Query Append, but this can break query folding. Once query folding is broken, Incremental Refresh will not work. Also, in Power BI service, you can configure and map only one gateway at a time.

    Fortunately, from one gateway I can reach to all the location. I was not aware of this before. I don't need multiple gateway. This eliminated the need for multiple gateways entirely.

    Recommended Approach (If you can reach all location from one gateway)

    • Create a separate query for each regional data source.
    • Ensure query folding is preserved on each query.
    • Load each regional table into the model.
    • Configure Incremental Refresh on each table individually.
    • Create a DAX calculated table that unions all regional tables.
    • Hide the individual regional tables from report view and use only the combined table.
    • Publish the dataset and report to Power BI Service.
    • Configure and map all source connections through that gateway.
    • Refresh and validate Incremental Refresh behavior.

     

    Important Note:
    The critical point is that the UNION should happen in the semantic model using DAX, not in Power Query.

    If you can not reach to all the location from one gateway, then one region one gateway in one report.

    • PauReis's avatar
      PauReis
      Icon for Resolver III rankResolver III

      Hi shafiz_rn,

      That is a clear write-up, and the DAX union call is right for the reason you gave, since appending in Power Query is what breaks folding and folding is what incremental refresh needs. Before you build it though, two of your own constraints collide, and it is a licensing wall rather than a design choice.

      Back on 11 August you said you have only a PPU license, and your summary says the report needs Publish to Web. Microsoft's PPU documentation states that content in a PPU workspace shared using Publish to Web is not accessible to unlicensed users. So the embed code would get created and it would still ask every Sales Manager for a PPU license, which is the opposite of what you need it for.

      The second collision is in the same line. You wrote Security Considered, and publish to web is not available for reports relying on row-level security to secure data. It is also worth being blunt about what publish to web exposes, because the warning is stronger than most people expect: anyone can access the underlying data in your model even if the report does not display it. With every region loaded into one model, that is every region's rows reachable by anyone holding the link.

      One operational point that is not in your eleven steps and will bite on the first change you make. Once a model with an incremental refresh policy has been published, republishing it from Desktop removes the existing partitions and the data in them. PPU does give you the XMLA endpoint, so make later schema changes with ALM Toolkit or TMSL rather than a Desktop republish, otherwise every small tweak costs a full reload of every regional table across every gateway.

      If sharing to people without licenses is genuinely fixed, I would solve that constraint first, because it decides whether this lives in Power BI at all or whether the report has to be somewhere else.

      • shafiz_rn's avatar
        shafiz_rn
        Regular Visitor

        Hi PauReis​ 

        Sales manager suppose to see all data. No hidden point. lower in the hierarchy will get report with filter. Most importantly all report will be thin.

        No, issue. 

        Also, will not republish model again and again. Develop all at once. Publish and will create report from the power bi semantic model as a source.

        Power bi will let you embed codes or publish to public. 

        This is my problem title : "how to append multiple server query and implement incremental refresh in power bi"

        I was not sure that i could connect all the location from one gateway. Also, in power bi, you only can use one gateway at a time. And that gateway will reach to every server and connect and start reading data. only problem is that you can not do it in power query. You need to take help of DAX. and also model size will increase a little bit. because of same table you load and union all of them.

        no, issue. Thanks for you thought.