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
eddd83 , Not very clear. You can have a date table with following columns
WeekDay = WEEKDAY([Date],2) //monday
Start of Week = [Date] -[WeekDay]+1 //monday
Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)
Measure =
var _max = maxx(allselected('Date'), 'Date'[Week Rank])
return
Calculate(min(Produce[Posted Price]) , filter(All('Date'), 'Date'[Week Rank]) =_max))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
- eddd835 years agoResolver I
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.
- v-deddai1-msft5 years agoCommunity Support
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