Forum Discussion
12 months rolling doesn't work
- 4 years ago
Hi Anonymous ,
According to your description, Month is a measure you created, so you can't use it in the SUM function which only accepts columns as parameter.
I create a sample and here's my solution, use the DATESINPERIOD and SUMX functions.
Create a measure.
EUR LTM = SUMX ( DATESINPERIOD ( 'Calendar'[Date], MAX ( 'Calendar'[Date] ), -12, MONTH ), 'Table1'[Month] )Get the correct result.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please considerAccept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
According to your description, Month is a measure you created, so you can't use it in the SUM function which only accepts columns as parameter.
I create a sample and here's my solution, use the DATESINPERIOD and SUMX functions.
Create a measure.
EUR LTM =
SUMX (
DATESINPERIOD ( 'Calendar'[Date], MAX ( 'Calendar'[Date] ), -12, MONTH ),
'Table1'[Month]
)
Get the correct result.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please considerAccept it as the solution to help the other members find it more quickly.
- Anonymous4 years agoNot applicable
Hi v-yanjiang-msft ,
thanks for the effort in helping me out!
I've tried the solution you offered, but can't get the values to work. Somehow I can't open the PBIX you sent (incompatible with my current version... we have an outdated system sadly 😐), but I've now included my own PBIX (can't add to a post yet, so uploaded it to WeTransfer), so perhaps you can check what I'm dping wrong?Thanks for helping me out!
- Anonymous4 years agoNot applicable
v-yanjiang-msft , I have to correct myself: it works like a charm! I had a error in my 'Month' formula which caused it to go wrong in January of each year ; once I fixed that, it was perfect.
Thanks for the effort!