Assume there's a table T1 with columns [state],[product],[price],[store],[date], and a time table T2. There's a relationship between T2's [pk_date] column and T1's [date] columnit.
and I create a measure [5days moving average price]:
calculate ( average('T1'[price]) , DATESINPERIOD ( 'T2'[pk_Date], LASTDATE ( 'T2'[pk_Date] )-1, -5, DAY ) )
but for certain state and product, is there anyway I can get a rank of stores based on the [5days moving average price]? I tried something like :=RANKX(ALLSELECTED('T1'[store]),[5Days Moving AVERAGE PRICE],,1) but it didn't work.