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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
brinky
Helper IV
Helper IV

12 months prior rolling year

Hi,

I have cretaed this measure wihich is RYR (ie July 2018 till June 2019)

Any idea how I could get the 12 months prior July 2018 (ie.July 2017 till June 2018)

 

RYR = 
CALCULATE(
    Grouped[GRP T QTY],
DATESINPERIOD(dDate[Date],
MAX(dDate[Date]),
-1,YEAR
)
)
1 ACCEPTED SOLUTION

@Ashish_Mathur Your measure didn't work but with some adjustments I manged to get it working. Thanks to your idea I was able to get the correct measure.

 

 

RYR = 
CALCULATE(
    Grouped[GRP T QTY],
DATESINPERIOD(dDate[Date],
MAX(dDate[Date]),
-1,YEAR
)
)
12M Prior RYR =CALCULATE(Grouped[RYR],SAMEPERIODLASTYEAR(dDate[Date]))

View solution in original post

9 REPLIES 9
Ashish_Mathur
Super User
Super User

Hi,

What is Grouped[GRP T QTY]? That looks like a column but the first input to the CALCULATE() function should be a measure. I do not understand.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur GRP T QTY is a sales measure for unit sales 

GRP T QTY = SUM(Grouped[quantity])

Hi,

Try this measure

RYR = CALCULATE([GRP T QTY],DATESYTD(dDate[Date],"30/6"))

RYR Previous = CALCULATE([RYR],SAMEPERIODLASTYEAR(dDate[Date]))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur Your measure didn't work but with some adjustments I manged to get it working. Thanks to your idea I was able to get the correct measure.

 

 

RYR = 
CALCULATE(
    Grouped[GRP T QTY],
DATESINPERIOD(dDate[Date],
MAX(dDate[Date]),
-1,YEAR
)
)
12M Prior RYR =CALCULATE(Grouped[RYR],SAMEPERIODLASTYEAR(dDate[Date]))

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
parry2k
Super User
Super User

@brinkyhow about changing -1 to -2



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k Thanks for your reply, did get a value, but defiently not a correct one.

@brinky if your -1 is giving the correct data I expect -2 will also give the correct data. May be you want to check your last year data as well.

 

Although if you can share sample pbix, it will help you to get the solution,



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k Maybe this could help as unfortunately I cannot share, ammount should be in region of 151,174 in measure3 (where I did -2)

data.JPG

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.

Top Solution Authors