One way to tackle this is to get the current month sequence in the quarter and subtract that many months to get the last month of the previous quarter.
e.g. May is the 5th month and 2nd month in Q2, subtracting 2 from 5 will get us to March (last month of Q1). Jun is the 6th month and 3rd month in Q2, subtracting 3 from 6 will get us to March again.
You need an offset month column in your Calendar table, for the case that we span years; i.e. for Jan/Feb/Mar you would need the value for Dec of previous Year. Offsets make things easier in general. offsetMonth = DATEDIFF( TODAY(), [Date], MONTH)
the measure for Total Amount is (you can modify for other measures):
Total Amount EndOfPrevQ =
VAR _currentMonth =
MONTH ( MAX ( Dates[Date] ) ) // Get the month number of the current date
VAR _currentMonthOffset =
MAX ( Dates[offsetMonth] ) // Get the offset month value for the current date
VAR _currentMonthSequenceInQ =
MOD ( _currentMonth - 1, 3 ) + 1 // Calculate the sequence of the current month within the quarter
VAR _endPreviousQuarterOffset = _currentMonthOffset - _currentMonthSequenceInQ // Calculate the offset for the end of the previous quarter
VAR _valuePreviousQ =
CALCULATE (
[Total Amount],
REMOVEFILTERS ( Dates ),
Dates[offsetMonth] = _endPreviousQuarterOffset
) // Calculate the total amount for the end of the previous quarter
RETURN
_valuePreviousQ