Microsoft Fabric Updates Blog

Automatic Retention Policy for Real-Time data in Power BI

When we introduced the first round of the Power BI REST APIs, we made it really easy for all different types of applications and devices to land data in Power BI. We have seen developer’s connect all kinds of IoT devices to Power BI in order to visualize and see the most data update in real-time in a Power BI dashbaord. However pumping in data at a couple hundred rows per second will cause your datasets to become very big very fast.

 

 

So what do you do with all this data? How do you enable real-time exploration and monitoring of data without maxing out the size of your datasets or your subscription? In the latest release of the API, we have introduced a default retention policy concept which will allow you to automatically clean up old data while keeping a constant window of new data flowing in.

The first retention policy that we have released is called basic first in first out (fifo). When enabled, data will collect in a table until it hits 200,000 rows. Once the data goes beyond 200,000 rows, the oldest rows will get dropped from the dataset. This will maintain between 200,000 and 210,000 rows of only the latest data.

 

 

The retention policies can be enabled when you first create your datasets. All you need to do is add the “defaultRetentionPolicy” parameter to your POST datasets call and set it equal to “basicFIFO” like so:

POST https://api.powerbi.com/beta/myorg/datasets?defaultRetentionPolicy=basicFIFOContent-Type: application/json Authorization: Bearer eyJ0-XXXXXXX-XXXXXX-XXXXXXX-6QNg

{  “name”: “SalesMarketing”,  “tables”: [    {      “name”: “Product”,      “columns”: [        {          “name”: “ProductID”,          “dataType”: “Int64”        },        {          “name”: “Name”,          “dataType”: “string”        },        {          “name”: “Category”,          “dataType”: “string”        },        {          “name”: “IsCompete”,          “dataType”: “bool”        },        {          “name”: “ManufacturedOn”,          “dataType”: “DateTime”        }      ]    }  ]}   

 

You can try the call out now using our interactive API console: http://docs.powerbi.apiary.io/#reference/datasets/datasets-collection/create-a-dataset.

For more information on the APIs please check out http://dev.PowerBI.com

Related blog posts

Automatic Retention Policy for Real-Time data in Power BI

October 17, 2023 by Lee Benjamin

You asked, we deliver! The option to create a customized pipeline of 2-10 stages is now available. Check it out!

October 9, 2023 by Kay Unkroth

We have some very exciting news to share with you today! We are thrilled to announce that we have just launched the public preview of Direct Lake mode for Power BI datasets in Fabric! Fabric is taking a bold bet on open data formats in OneLake.