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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
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
Greg_Deckler
Community Champion
Community Champion

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...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

1 REPLY 1
Greg_Deckler
Community Champion
Community Champion

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...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.