Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello,
I have a data set with water quality measuring results which vary form day tot day.
I am trying to show the results of the last 365 days, starting with the most recent data point, wich may vary, depending on the most recent downloaded data set.
I managed to filter for the relative date, for the past 365 days. The problem is that this filter first looks to the present day (e.g. 17-7-2023) but I need it to start from the most recent data point, wich is at 22-6-2023. And starting from 22-6-2023, show the results from the past 365 days.
I'm guessing that I first need to make a measure that can determine the most recent result and generate the results of the past 365 days.
My question; how can I make such a measure
Solved! Go to Solution.
Hi @Water_question ,
I suggest you to try code as below to create a measure.
Data in Last 365 Days =
VAR _RecentPoint = CALCULATE(MAX('Table'[Date]),ALL('Table'))
VAR _Measure = CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Date]>=_RecentPoint-365 && 'Table'[Date]<=_RecentPoint))
RETURN
_Measure
Data in my sample is from 2021/01/01 to 2023/06/22. Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Water_question ,
I suggest you to try code as below to create a measure.
Data in Last 365 Days =
VAR _RecentPoint = CALCULATE(MAX('Table'[Date]),ALL('Table'))
VAR _Measure = CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Date]>=_RecentPoint-365 && 'Table'[Date]<=_RecentPoint))
RETURN
_Measure
Data in my sample is from 2021/01/01 to 2023/06/22. Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.