Previous 12 months sales by month based on selected slicer values

Hi @schuhtl,

Not 100% sure this is what you’re looking for but it should get the party started :wink:

  • Table A, works with the date slicer on Year & Month
  • Table B, doesn’t interact with the date slicer on Year & Month but has a fixed filter in the Filter Pane

Created this measure for Table A

Sales in last 12M = 
VAR myMonthOffset =
    CALCULATE( MAX( Dates[MonthOffset] ),
        ALLSELECTED( Dates[Month & Year] ),
        ALLEXCEPT( Dates, Dates[Month & Year] )
    )
RETURN

CALCULATE( [Total Sales],
    FILTER( ALL(Dates),
        Dates[MonthOffset] >= myMonthOffset -12 &&
        Dates[MonthOffset] <= myMonthOffset
    )
)

.
You can find the M code for the Date table including Offsets here:

I hope this is helpful. Here’s my sample file.
eDNA - Previous 12 months sales.pbix (451.3 KB)