Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I have a parameter I created to enable a dynamic date axis on a matrix table. This allows the user to select the date intervals, (for a date range selected elsewhere), which shows the intervals as the column headers. It calculates the totals correctly.
Hi @CherC
Yes, you can create a "Period-over-Period" measure that is conditional on the Axis selection.
Here are some examples:
1. If you have already defined measures Year/Year % etc:
Sales Period-over-Period % =
VAR AxisSelection =
SELECTCOLUMNS ( 'Axis', 'Axis'[Axis] )
VAR Result =
IF (
COUNTROWS ( AxisSelection ) = 1, -- Single parameter selection
SWITCH (
AxisSelection,
"Year", [Year/Year %],
"Quarter", [Quarter/Quarter %],
"Month", [Month/Month %],
"Week", [Week/Week %]
)
)
RETURN
Result
2. If you want to include the calcs all within a single measure (assuming the underlying measure is Sales) :
Sales Period-over-Period % =
VAR AxisSelection =
SELECTCOLUMNS ( 'Axis', 'Axis'[Axis] )
VAR Result =
IF (
COUNTROWS ( AxisSelection ) = 1, -- Single parameter selection
VAR ValueCurrentPeriod = [Sales]
VAR ValuePreviousPeriod =
SWITCH (
AxisSelection,
"Year", CALCULATE ( [Sales], SAMEPERIODLASTYEAR ( 'dates'[Date] ) ),
"Quarter", CALCULATE ( [Sales], DATEADD ( 'dates'[Date], -1, QUARTER ) ),
"Month", CALCULATE ( [Sales], DATEADD ( 'dates'[Date], -1, MONTH ) ),
"Week", CALCULATE ( [Sales], DATEADD ( 'dates'[Date], -7, DAY ) )
)
RETURN
DIVIDE ( ValueCurrentPeriod - ValuePreviousPeriod, ValuePreviousPeriod )
)
RETURN
Result
Does something like this work for you?
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 6 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 16 | |
| 8 | |
| 8 | |
| 8 |