pbi_create_rolling_average_measure
Creates a trailing rolling average measure in Power BI by generating a DAX expression using AVERAGEX and DATESINPERIOD. Specify the base measure, window size, date table, and granularity.
Instructions
Create a trailing rolling average measure.
DAX template:
AVERAGEX(DATESINPERIOD({date_table}[{date_column}], LASTDATE({date_table}[{date_column}]), -{window}, {granularity}), [{base}])
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | ||
| window | Yes | ||
| overwrite | No | ||
| date_table | Yes | ||
| date_column | Yes | ||
| granularity | No | month | |
| base_measure | Yes | ||
| measure_name | No | ||
| format_string | No | ||
| display_folder | No | Rolling |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |