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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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