cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Marcin Helper V
Helper V

12 month sum indicator

Hi,

 

let assume we have data like this :

 

DateSales
01.01.2017-30
01.02.201794
01.03.201763
01.04.201790
01.05.201750
01.06.2017-14
01.07.201746
01.08.2017-51
01.09.2017-76
01.10.201765
01.11.2017-14
01.12.2017-65
01.01.201853
01.02.2018-34
01.03.201886
01.04.2018-51
01.05.201826
01.06.2018-25
01.07.201885
01.08.2018-24
01.09.201871
01.10.2018-10
01.11.201810
01.12.2018-70

 

I would like to create measure that will be working as 12 months sum but only in 12 months period of time : time <= maxdate, time >= maxdate - 12.

 

I have created a measue like this :

Last 12 months = CALCULATE(SUM(Table1[Sales]),DATESINPERIOD(Table1[Date],LASTDATE(Table1[Date]),-12,MONTH))
 
But now I would like to adjust it to get only last 12 month values but sum to be caluculated also as a total of months before last 12 month. 

 

I would like to get a view like this ( alwyays for last 12 months )  and count how many of values per month was negative. 

 

 Capture.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Super User IV
Super User IV

Re: 12 month sum indicator

See if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...


---------------------------------------

Not the Power BI thought police...

I have NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

View solution in original post

1 REPLY 1
Super User IV
Super User IV

Re: 12 month sum indicator

See if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...


---------------------------------------

Not the Power BI thought police...

I have NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

View solution in original post

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Top Solution Authors
Top Kudoed Authors