Pivot Table Issues

Make Excel Power Pivot Measures Dynamic by Month

Khadija KhanKhadija Khan Nov 18, 2026 869 views

Question details

Make Power Pivot measures respond to a selected month without manually changing period codes.

Make Excel Power Pivot Measures Dynamic by Month
Product
Microsoft Excel Power Pivot
Device & OS
not provided
Scenario
Period codes such as A2210 and B2210 change as the reporting month changes.
Observed behavior
Measures use hard-coded period codes that must be edited for each new month.
Before you start

Check that Power Pivot is available in your Excel edition and identify the table, amount column, and period-code column used by your measures. The example below assumes codes consist of a one-character prefix followed by a two-digit year and two-digit month.

Solution 1Recommended

Use a month column and slicer to filter Power Pivot measures

Select a reporting month in the PivotTable instead of editing period codes in each measure.

A month column gives the data model a common value for codes such as A2210 and B2210. A slicer can filter that column, and measures respond through the PivotTable's filter context.

INDIRECT is an Excel worksheet function, not a DAX function. A measure cannot directly read an arbitrary worksheet cell; a worksheet selection must be loaded into the model or applied through a PivotTable filter.

1
Open the data model

In Excel, open the Power Pivot tab and select Manage. In Data View, select the table containing your period codes.

2
Add a month column

Select Add Column and enter =DATE(2000 + VALUE(MID([PeriodCode], 2, 2)), VALUE(RIGHT([PeriodCode], 2)), 1). Replace PeriodCode with your actual column name, then name the new column PeriodMonth. For example, A2210 and B2210 both produce October 1, 2022.

3
Remove the fixed period filter

In Power Pivot, edit the measure to remove the hard-coded month code. For example, use =SUM(Sales[Amount]), replacing Sales and Amount with your table and column names. Keep any other filters your calculation requires.

4
Add a month slicer

Return to the PivotTable, select PivotTable Analyze > Insert Slicer, and choose PeriodMonth. Select the desired month in the slicer; the measure will calculate for rows in that month.

5
Check both prefixes

Select October 2022 in the slicer and compare the result with the source rows for A2210 and B2210. If a measure should include only one prefix, retain a separate prefix filter in that measure.

Use a month column and slicer to filter Power Pivot measures
Selecting a month versus using the current month: A slicer lets you change the month without editing the measure, but it does not automatically select each new month. Use a current-month DAX filter if the report must advance automatically.
Free Microsoft Office alternative

Work with monthly spreadsheets in WPS Office

WPS Office is a free, lightweight alternative with a familiar spreadsheet interface and Microsoft Office format compatibility, making it easy to move everyday spreadsheet work. It does not repair Excel Power Pivot or replace its data-model measures.

Review and filter monthly spreadsheet data in WPS Spreadsheet.Open and save Microsoft Excel formats, including XLSX.Use a familiar interface for everyday spreadsheet tasks.Move routine spreadsheet work to a lightweight Office alternative.
QA img-9

Frequently Asked Questions

Can a Power Pivot measure use INDIRECT to read a worksheet cell?

No. INDIRECT is a worksheet function, not a DAX function, and a DAX measure cannot directly read an arbitrary worksheet cell. Load a selection table into the data model or use a PivotTable slicer to apply the selected month.

How can a measure always use the current month?

With the example PeriodMonth column, a measure can use =CALCULATE(SUM(Sales[Amount]), FILTER(ALL(Sales[PeriodMonth]), Sales[PeriodMonth] = DATE(YEAR(TODAY()), MONTH(TODAY()), 1))). Replace the table and column names, and refresh or recalculate the model as needed.

Will the month slicer include both A and B period codes?

Yes, if both codes map to the same PeriodMonth and no other filter excludes either prefix. Add or retain a separate prefix filter if a measure should include only A or only B.

What if my period codes use a different format?

Adjust the calculated-column formula in Power Pivot to match the position and length of the year and month in your codes. Check the resulting dates against the source data before using the column in a slicer.