Hopp til hovedinnhold

Get aggregated time series data from CDF

Cognite Data Fusion (CDF) pre-calculates the most common aggregates for numerical data points in time series. These aggregates are available with short response times even when you are querying across large data sets.

Instead of downloading and manually aggregating data in Power BI, you can query CDF for the aggregates. Specify the time range and the granularity (the unit of time to compute the aggregates for) and let CDF do the computational work for you.

Get aggregates for a single time series

To retrieve aggregates for a single time series from CDF in the Power Query Editor:

  1. Connect Power BI to CDF.

  2. In the Power Query Editor, get the time series table using the Cognite Power BI connector.

    Time series table
  3. Use filtering to find the time series you want aggregates from, and then in the Aggregate column, select Function.

    Aggregate function
  4. Specify the time range and granularity, and then select OK.

  5. The Power Query Editor displays a table with the aggregates for the specified time range. Remove the columns you don't need, then select Close and apply.

Get aggregates for many time series

To retrieve aggregates from many time series in the same time range, use the TimeseriesAggregate function.

Instead of calling the function on a single time series, you first create a time series table with all the time series you want to retrieve aggregates from:

  1. Import your time series data and the TimeseriesAggregate function using the Cognite Power BI connector.

    Time series table and function
  2. Use filtering to find the time series you want aggregates from.

  3. In the Queries panel, select the TimeseriesAggregate function and set the granularity, start time, and end time. Then select Choose column.

  4. In the Select Column window, select your Timeseries table and the Id column from the table to specify which time series to fetch aggregates from in CDF. Then select OK.

    Time series table
  5. Select Invoke to start retrieving the aggregates.

  6. The Power Query Editor displays a new table named Invoked Function in the Query panel with the aggregates for the specified time range. Remove the columns you don't need, then select Close and apply.

tips

If the TimeseriesAggregate function takes a long time to finish or fails after a long time:

  • Make sure you have filtered the time series table to contain only the time series you need.

  • Consider if you are using the right granularity. The granularity significantly affects the query performance.

  • Request a realistic number of data points. Aggregating large numbers of time series with short granularity may return vast amounts of data points, and Power BI doesn't handle many gigabytes of data in a single query.