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.
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.
Step one
Consumption = sum('5 Stock Movement Report'[Consumption Value])
Step two
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?
Many thanks,
Solved! Go to Solution.
Hi @jaywakeford
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.
Hi @jaywakeford
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |