pbi_create_variance_measure
Creates a period-over-period variance measure in Power BI, comparing current period to a previous one with configurable offset and granularity (year, month, quarter).
Instructions
Create a period-over-period variance measure.
DAX template (parametrised by granularity ∈ {year, month, quarter}):
[{base}] - CALCULATE([{base}], DATEADD({date_table}[{date_column}], {offset}, {granularity}))
Default compare_period_offset = -1 ⇒ "current period vs previous one".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | ||
| overwrite | No | ||
| date_table | Yes | ||
| date_column | Yes | ||
| granularity | No | year | |
| base_measure | Yes | ||
| measure_name | No | ||
| format_string | No | ||
| display_folder | No | Variance | |
| compare_period_offset | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |