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}])
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"table": "<table>",
"base_measure": "<base_measure>",
"window": "<window>",
"date_table": "<date_table>",
"date_column": "<date_column>"
},
"name": "pbi_create_rolling_average_measure"
}
}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 |