Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Anonymous
Not applicable

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  @Anonymous 

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  @Anonymous 

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.
Anonymous
Not applicable

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

vanessafvg
Super User
Super User

@Anonymous   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!




Anonymous
Not applicable

@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
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.