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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

DAX measure for rolling one year calculation

Hi all,

I need to create a measure for the following simplified scenario. 

In my data set there is a date column and a value calumn. There is one record per day ( exccluding weekends and hilodays ) in this dataset.

In my visualizaation I have to skip first 252 days (first year ) , and for any given date after that divide the value for that date by the value for the day 252 prior to that date.

example 

Date                                                 Value

5/5/2016 ( start date)             101

5/6/2016                                         99

...

5/5/2017                                          105

5/6/2017                                          103

....

------------------------------------------------------------------------------------------------------------------

My visualtion should display the following .   Please note I don't wnat to show any records prior to 5/5/2017 in the visualization because there is no data for dates prior to   5/5/2016 in the dataset     (Date - Year ago)

5/5/2017                                         1.039    (calculation is : 105/101)

5/6/2017                                          1.040   (103/99)

........  

I hopw I was able to exxplain the requirment clearly. Thank you for you help.

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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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