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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
Super User
Super User

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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

1 REPLY 1
Greg_Deckler
Super User
Super User

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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.