Forum Discussion
Anonymous
5 years agoNot applicable
Show last 12 months data
Hi , I need to display Last 12 months data for a measure deoending on Year and Month selection. I managed to write the measure, but when put in the Line chart, it gets filtered only for the select...
- 5 years ago
Hi Anonymous ,
Did you have a dim_ date table? I suggest you create a date table and then you can use the following measure:
Last 12 months Sales = VAR Start_date = CALCULATE ( MAX ( Dim_Date[Date] ), ALLSELECTED ( Dim_Date ) ) RETURN CALCULATE ( [Measure], ALL ( Dim_Date ), DATESINPERIOD ( Dim_Date[Date], [Start_date], -12, MONTH ) )If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
v-deddai1-msft
Community Support
5 years agoHi Anonymous ,
Did you have a dim_ date table? I suggest you create a date table and then you can use the following measure:
Last 12 months Sales =
VAR Start_date =
CALCULATE ( MAX ( Dim_Date[Date] ), ALLSELECTED ( Dim_Date ) )
RETURN
CALCULATE (
[Measure],
ALL ( Dim_Date ),
DATESINPERIOD ( Dim_Date[Date], [Start_date], -12, MONTH )
)
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai