Forum Discussion
keep filter ( ) + filter ( all ( ) )
- 5 years ago
eddd83 not sure if you would like it, but I solved it using a different measure.
Revised Price := VAR _1 = MAX(Dates[Date]) VAR _2 = CALCULATE(MAX(Dates[Date]),FILTER(ALL(Dates),Dates[Date]<=_1&&[Max Revised date]<>0)) VAR _3 = CALCULATE([MaxPrice],ALL(Dates[Date]),Dates[Date]=_2) RETURN _3
sorry for the confusion. Please see the one drive link with my file:
Basically my measure (posted price) works for the weekdays, but returns a blank for the weekends. Ideally for the weekdays, it would show the previous friday (10/23) in this scenario.
Hi eddd83 ,
You can create a new weekday column in your Date table :
weekday = WEEKDAY(Dates[Date],2)
Then use REMOVEFILTER to clear filter from slicer in [posted price]:
_posted price = var a = IF(SELECTEDVALUE(Dates[weekday])<=5,MAX(Dates[Date]),CALCULATE(MAX(Dates[Date]),FILTER(ALL(Dates),Dates[Date]<=MAX(Dates[Date])&&Dates[weekday]<=5))) return CALCULATE(MIN('Posted Prices'[Price]),'Posted Prices'[Price Date] = a,REMOVEFILTERS(Dates[Date]))
For more details, please refer to the pbix file: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EUfmRSl0n3VLrP3tbkfEUg0Bg-YVEgmdGNbBs9Xb9iDDUg?e=BXBikd
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai