Hello, I am new to DAX
Have a table with a week ending date in one field and value in another field.
Relationship is established to a second table that has week ending dates that is used as a slicer for the data.
Trying to return the sum of value between the selected week ending date and the previous 13 weeks inclusive of the selected week.
Consumption = sum('5 Stock Movement Report'[Consumption Value])
Last 13 Weeks Consumption = calculate([Consumption],dateadd('5 Stock Movement Report'[Week Ending],-91,DAY))
Step 2 returns a value of (blank)
I was able to correctly return the date that cooresponds the the 13 weeks prior to the selected date. Checked this by creating the dateadd measure on its own.
Is there a solution that someone can share that solves this?
Go to Solution.
Try DatesInPeriod instead:
DATESINPERIOD( Calendar[Date] , MAX(Calendrier[Date]) , -91 , DAY )
It will return a table with the last 91 days from the 2nd argument (included) which you can use as a filter argument in your measures.
Thank you very much for the reply and answer!
Conceptually it seems to make perfect logical sense. And works perfectly.
Engage and empower students with Power BI!
Continue your learning in our online communities.
Travel to Melbourne and network with thousands of peers!