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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

stop date sum running 12 month

I have this measure, that i want to stop at last closed month. Measure is the line value

 

lbn 12 =
CALCULATE (
SUMX('running 12',[Salesrunning.PNG] ),
DATESINPERIOD (
'running 12'[SalesDate].[Date] ,
LASTDATE ( 'running 12'[SalesDate].[Date] ),
-12,
MONTH
)
    )
1 ACCEPTED SOLUTION

@Anonymous , Try if this formula can help

 

bn 12 =
var _max = maxx(allselected('running 12'),'running 12'[SalesDate].[Date])
return
CALCULATE (
SUMX('running 12',[Salesrunning.PNG] ),
DATESINPERIOD (
'running 12'[SalesDate].[Date] ,
LASTDATE ( 'running 12'[SalesDate].[Date] ),
-12,
MONTH
) , 'running 12'[SalesDate].[Date] <= _max
)

 

or refer to this video, as I doubt above will give rolling 12 month :   https://www.youtube.com/watch?v=duMSovyosXE

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

lbn 12 =
CALCULATE (
SUMX('running 12',[Sales] ),
DATESINPERIOD ('running 12'[SalesDate].[Date] ,
LASTDATE ( 'running 12'[SalesDate].[Date] ),
-12,
MONTH
)
    )
Anonymous
Not applicable

Sorry for missplacing pic. 😉

@Anonymous , Try if this formula can help

 

bn 12 =
var _max = maxx(allselected('running 12'),'running 12'[SalesDate].[Date])
return
CALCULATE (
SUMX('running 12',[Salesrunning.PNG] ),
DATESINPERIOD (
'running 12'[SalesDate].[Date] ,
LASTDATE ( 'running 12'[SalesDate].[Date] ),
-12,
MONTH
) , 'running 12'[SalesDate].[Date] <= _max
)

 

or refer to this video, as I doubt above will give rolling 12 month :   https://www.youtube.com/watch?v=duMSovyosXE

Anonymous
Not applicable

Sorry 🙂 was a bit to fast in conclusion 

It worked with a little twist from your video

Anonymous
Not applicable

Didn't work🤔

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.