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

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Rolling 12 months calculation

I would like to create a column that takes TRUE for all those values that are returned within the rolling months as of the previous month. So for example, we are in August 2018, I would need the column to give a true for all those values from July 2017 to July 2018. Similarly, in September 2018, it would need to be August 17 - August 18

3 REPLIES 3
v-yuta-msft
Community Support
Community Support

Hi Akshaya,

 

As a general solution, you can create a measure using this pattern:

 

VAR Previous_Month =
EDATE ( MAX ( Table[Date] ), -1 )
VARPrevious_12_Month =
EDATE ( MAX ( Table[Date] ), -13 )
RETURNResult =
CALCULATE (
    Your_Aggregation_Here,
    FILTER (
        Table,
        Table[Date] >= Previous_Month
            && Table[Date] <= Previous_12_Month
    )
)

Regards,

Jimmy Tao

 

Anonymous
Not applicable

Hey,

 

I'm not quite sure as to what would go under "Your_Aggregation_Here". Also, would this result in a TRUE or FALSE value?

 

I would want the Flag column that I am creating to look like this:

 

Flag   Year     Month  Day

0        2017    Jan        15

0        2017    Jan         16

.

.

.

1       2017    July        1

1       2017    July         2

.

.

.

1      2018      July         31

 

 

Similarly, once we go to August 2018, Flag should be 1 from August 1, 2017 - August 31, 2018

Anonymous
Not applicable

Thank you. So the part "your_aggregation_here" is the variable name that I would create right?

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.