Forum Discussion
Anonymous
6 years agoNot applicable
SSAS tabular cube previous month data
Hi team, below is my data and yellow color is my expected output. i want to get previous month data. in below "Total" column is my measure and i want to get lag/previous month measure "Previous ...
- 6 years ago
Hi Anonymous ,
Sorry, please update the measure as below.
Total Previous Month = VAR pre = EDATE ( MAX('DIM_REVENUE'[date]), -1 ) VAR preym = FORMAT ( pre, "mmm yyyy" ) RETURN CALCULATE ( SUM ( DIM_REVENUE[Revenue] ), FILTER ( ALLSELECTED(DIM_REVENUE), DIM_REVENUE[Month Name] = preym ) )Pbix as attached.
- Anonymous6 years ago
v-frfei-msft
6 years agoCommunity Support
Hi Anonymous ,
Please try this one please.
Total Previous Month =
VAR pre =
EDATE ( TODAY (), -1 )
VAR preym =
FORMAT ( pre, "mmm yyyy" )
RETURN
CALCULATE (
SUM ( DIM_REVENUE[Revenue] ),
FILTER ( DIM_REVENUE, DIM_REVENUE[Month Name] = preym )
)
- Anonymous6 years agoNot applicable
Hi v-frfei-msft ,
i have implemented same query given by you and below is the output. i am getting only one month data. would you please suggest any more methods to get all month data.
Regards,
snkm