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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
KyongHan
Frequent Visitor

Specify a specific date in calendar column for datesinperiod

Hi all,

 

i am calculating rolling 7 day average with  averagex and datesinperiod.  

AVERAGEX(DATESINPERIOD('calendar'[Date],MAX('calendar'[Date]),-7,DAY)

For start_date, instead of using max(calendar[date]), how can i go about refer a specific date in calendar column?  I have multiple measures for averagex so i do not want to go to each measure to change, but want them to reference a date_expression i can change.

2 REPLIES 2
vanessafvg
Super User
Super User

what date are you wanting to set?  for example you could just create a calculated column with the logic and that column could be referenced by multiple measures. 

 

or you can just set a variable in each of your measures ie.

 

measurename = 

var  dt= specified date expression, selected date?

return  measure including dt as your startdate in your calc

 

if you give more information like your current measure calc.  that could be useful too.





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




my calendar[date] is dated from 11/1/2020 - 12/31/2022.  I use last year 7 day moving average, current year 7 day moving average, and budget 7 day moving average in one graph.  I use a slicer to fixate date between 12/1/2021 - 3/31/2022.  sometimes the volumes for latest date is a bit understated so i want to use the prior date (i.e. 3/17/2022 data is showing only half volume against prior week so I know for sure data has not fully populated, so I want to use moving average through 3/16 instead).  The reason I use 3/31 is because i want to show budget thru end of quarter.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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