cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ppatris
Helper II
Helper II

12 month sum in a matrix table

Dear All,

 

I would like to ask for your support. What I am trying to do is to create a table where I will be to sum of the last 12 Months. 

 

I could achieve that by creating the below:

 

12m rolling = CALCULATE([ST month],LASTDATE('Dates EDM'[Date].[Date]))+CALCULATE([ST month],DATEADD('Dates EDM'[Date].[Date],-1,MONTH))+CALCULATE([ST month],DATEADD('Dates EDM'[Date].[Date],-2,MONTH))+CALCULATE([ST month],DATEADD('Dates EDM'[Date].[Date],-3,MONTH))+CALCULATE([ST month],DATEADD('Dates EDM'[Date].[Date],-4,MONTH))+CALCULATE([ST month],DATEADD('Dates EDM'[Date].[Date],-5,MONTH))+CALCULATE([ST month],DATEADD('Dates EDM'[Date].[Date],-6,MONTH))+CALCULATE([ST month],DATEADD('Dates EDM'[Date].[Date],-7,MONTH))+CALCULATE([ST month],DATEADD('Dates EDM'[Date].[Date],-8,MONTH))+CALCULATE([ST month],DATEADD('Dates EDM'[Date].[Date],-9,MONTH))+CALCULATE([ST month],DATEADD('Dates EDM'[Date].[Date],-10,MONTH))+CALCULATE([ST month],DATEADD('Dates EDM'[Date].[Date],-11,MONTH))
 
The only problem is that then on my table it includes all the months of 2020.
Capture.PNG
How could I stop it and show just the till the last month on my calendar?
 
let me know in case you need any further explanations.
 
Cheers,

Paris
1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi  @ppatris 

From your formula we could know that you are using built-in date hierarchy of power bi for calculation.

So for your case, you could add a new measure as below:

Measure = IF(ISBLANK(MAX('Dates EDM'[Date])),BLANK(),[12m rolling])

Result:

4.JPG

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-lili6-msft
Community Support
Community Support

hi  @ppatris 

From your formula we could know that you are using built-in date hierarchy of power bi for calculation.

So for your case, you could add a new measure as below:

Measure = IF(ISBLANK(MAX('Dates EDM'[Date])),BLANK(),[12m rolling])

Result:

4.JPG

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-lili6-msft  thank you very much it worked perfectly! 🙂

vanessafvg
Super User
Super User

@ppatris   have you tried using a data slicer and limiting the range?   what exactly are you trying to do?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




@vanessafvg Hi Vanessa,

 

There are no dates furtherly than Jan-2020 into my calendar. The reason why i see more dates is because it sums 12 months before. That means that on December 2020 it will find the info of Jan-20 and it will show it.

 

thanks for your support.

 

 

Helpful resources

Announcements
September Update

Check it Out!

Click here to learn more about the September 2022 updates!

Power BI Show episode 9

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power BI Dev Camp Session 26

New Date - Check it Out!

Mark your calendars and join us on Thursday, October 6 at 11a PDT for a great session with Ted Pattison!

Top Solution Authors