Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon'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.
I have a table of weights and dates and need to find a weight within a window of time (- 25 to -35 days) AND then find the Wt that is closest to the actual 30 day date. I can easily find the max weight within that window of time, but am struggling with how I would remove the Max and filter for the value closest to the actual 30 day mark.
ID Date WT
123 12/01/20 150
123 11/29/20 152
123 12/5/20 151.5
123 1/1/21 151
Return for the 1/1//21 Date would be 150 (12/1/20 wt). Falls in the 30 day =/-5 days and is closest to actual 30 days.
Any help would be so appreciated.
Solved! Go to Solution.
Hi @Allisond ,
Create a date table and use it as silicer. Check the measures.
Measure = IF(SELECTEDVALUE('Table 2'[Date])<=SELECTEDVALUE('Table'[Date]),BLANK(),ABS(ABS(DATEDIFF(SELECTEDVALUE('Table 2'[Date]),SELECTEDVALUE('Table'[Date]),DAY))-30))
Measure 2 =
var min_ = MINX(FILTER('Table',[Measure]<>BLANK()),[Measure])
return
IF(ISBLANK(min_)||min_>24,BLANK(),CALCULATE(SUM('Table'[WT]),FILTER('Table',[Measure]=min_)))
Best Regards,
Jay
Hi @Allisond ,
Create a date table and use it as silicer. Check the measures.
Measure = IF(SELECTEDVALUE('Table 2'[Date])<=SELECTEDVALUE('Table'[Date]),BLANK(),ABS(ABS(DATEDIFF(SELECTEDVALUE('Table 2'[Date]),SELECTEDVALUE('Table'[Date]),DAY))-30))
Measure 2 =
var min_ = MINX(FILTER('Table',[Measure]<>BLANK()),[Measure])
return
IF(ISBLANK(min_)||min_>24,BLANK(),CALCULATE(SUM('Table'[WT]),FILTER('Table',[Measure]=min_)))
Best Regards,
Jay
Nah, this won't work. You need to describe how to break ties when (for example) one weight was done on 12/1/20 and another one on 12/3/20. Why not intrapolate between the two weights ?
Also what should happen when there was no weight taken in the -35..-25 timeframe?
Blank if no weight in the window.
What do you mean by intrapoloate between 2 weights? -- sorry somewhat of a newbee here.
Say you have 150 on 12/1 and 153 on 12/4. Draw a line between them and you get 151 for 12/2.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
143 | |
85 | |
66 | |
51 | |
45 |
User | Count |
---|---|
216 | |
89 | |
82 | |
66 | |
57 |