Forum Discussion

tobny76's avatar
tobny76
Icon for Helper III rankHelper III
1 year ago
Solved

Incremantal refresh without a closedate

Hi ,

I have big challenges with finding a way for doing incremental refresh on one of my semantic models.

The data is about serviceorders and is about 85M rows right now.

The challenge is that I don't have a "close date" on the service order, only a status column saying that the order is closed.


What I want to achive is
- All orders that have status closed should be archived and not loaded again,
  of course I need to check for new orders with status closed every day.
- All orders that do not have the closed status can be changed so I guess I always need to do full load on them
  (Create_date can be 1 year old and updated today to status closed.)

Do you have any suggestions for how I can solve this without reloading alot of already closed service orders every day without having a close date?

Regards
Tobias

  • Hi tobny76 - To implement an efficient incremental refresh process for your semantic model, given your scenario where you lack a "close date" and rely on the status column to determine whether an order is "closed,"

    Steps to Implement
    1. Pre-process Data in Source (Optional but Ideal)
    If you can preprocess data in your database or ETL pipeline:

    Use a query or stored procedure to filter:
    Active Orders: Orders where status != 'closed'.
    Archived Orders: Orders where status = 'closed'.
    Store them in separate staging tables for efficient incremental loads.

    2. Implement Logic in Power BI
    Use Power Query for incremental refresh setup:

    a. Define Archived and Active Orders Queries
    Archived Orders Query:

    Use a filter to retrieve only orders where status = 'closed'.
    Implement incremental refresh for this query:
    Define a date field to partition data (e.g., Create_Date or Last_Modified_Date).
    Configure the RangeStart and RangeEnd parameters for incremental refresh in Power BI.
    Archive orders as they transition to the closed status.
    Active Orders Query:

    Filter for status != 'closed'.
    Perform a full refresh daily, as these rows may change.
    b. Merge the Queries
    Once both queries are set up, combine the active and archived partitions into a single dataset:

    Use UNION or append in Power BI or SQL.
    3. Automate Daily Refresh
    Set up a scheduled refresh in the Power BI service:
    Active Orders: Full refresh daily.
    Archived Orders: Incremental refresh daily.
    4. Address the Lack of a Close Date
    To avoid reprocessing all orders unnecessarily:

    Use a Last Modified Timestamp: If available, this can help identify when an order's status last changed.
    Derived Close Date: If feasible, generate a Close_Date in your source system or ETL by recording the date when status changes to closed. This can make incremental archiving more efficient.

     

    Hope this approach helps.

2 Replies

  • Hi tobny76 - To implement an efficient incremental refresh process for your semantic model, given your scenario where you lack a "close date" and rely on the status column to determine whether an order is "closed,"

    Steps to Implement
    1. Pre-process Data in Source (Optional but Ideal)
    If you can preprocess data in your database or ETL pipeline:

    Use a query or stored procedure to filter:
    Active Orders: Orders where status != 'closed'.
    Archived Orders: Orders where status = 'closed'.
    Store them in separate staging tables for efficient incremental loads.

    2. Implement Logic in Power BI
    Use Power Query for incremental refresh setup:

    a. Define Archived and Active Orders Queries
    Archived Orders Query:

    Use a filter to retrieve only orders where status = 'closed'.
    Implement incremental refresh for this query:
    Define a date field to partition data (e.g., Create_Date or Last_Modified_Date).
    Configure the RangeStart and RangeEnd parameters for incremental refresh in Power BI.
    Archive orders as they transition to the closed status.
    Active Orders Query:

    Filter for status != 'closed'.
    Perform a full refresh daily, as these rows may change.
    b. Merge the Queries
    Once both queries are set up, combine the active and archived partitions into a single dataset:

    Use UNION or append in Power BI or SQL.
    3. Automate Daily Refresh
    Set up a scheduled refresh in the Power BI service:
    Active Orders: Full refresh daily.
    Archived Orders: Incremental refresh daily.
    4. Address the Lack of a Close Date
    To avoid reprocessing all orders unnecessarily:

    Use a Last Modified Timestamp: If available, this can help identify when an order's status last changed.
    Derived Close Date: If feasible, generate a Close_Date in your source system or ETL by recording the date when status changes to closed. This can make incremental archiving more efficient.

     

    Hope this approach helps.

    • tobny76's avatar
      tobny76
      Icon for Helper III rankHelper III

      Hi!
      I now have one table in Power BI with incremental load for closed and one for open with full load.
      The next step is append in Power BI.
      Should I disable load of my Incremental table and append to the open table.
      If I will do that I guess I will have one partition for all rows.

      Or should I append my full load query to the Incremental query?
      I don't want to double store the big history table that is 85milj rows right now.