Forum Discussion
Conditional filtering date ranges - Help with import
- 9 years ago
Hi aristen,
So if the user selects 10.feb to 15.feb i would still get values from FactMeteorologyTimeseries from 01.Jan and forward.
Do you know why this is ?
Not like measures, calculate columns/tables are computed during database processing(e.g. data refresh) and then stored in the model, they do not response to user selections on the report.
In your scenario, you should use the formula to create a measure similar like below, then show the measure on the Table/Matrix visual with the corresponding columns from your table(or use the measure as visual level filter with Expand Date for T3 is not blank ). :smileyhappy:
Expand Date for T3 = VAR minDateSelected = DimDate[min] VAR maxDateSelected = DimDate[max] VAR tenDaysPrevious = minDateSelected - 10 VAR tenDaysAfter = maxDateSelected + 10 RETURN COUNTROWS ( FILTER ( 'dpv FactMeteorologyTimeSeries'; 'dpv FactMeteorologyTimeSeries'[ForecastTime].[Date] >= DATE ( YEAR ( 'dpv FactMeteorologyTimeSeries'[ForecastTime].[Date] ); MONTH ( tenDaysPrevious ); DAY ( tenDaysPrevious ) ) && 'dpv FactMeteorologyTimeSeries'[ForecastTime].[Date] <= DATE ( YEAR ( 'dpv FactMeteorologyTimeSeries'[ForecastTime].[Date] ); MONTH ( tenDaysAfter ); DAY ( tenDaysAfter ) ) ) )Regards
Hi aristen,
So if the user selects 10.feb to 15.feb i would still get values from FactMeteorologyTimeseries from 01.Jan and forward.
Do you know why this is ?
Not like measures, calculate columns/tables are computed during database processing(e.g. data refresh) and then stored in the model, they do not response to user selections on the report.
In your scenario, you should use the formula to create a measure similar like below, then show the measure on the Table/Matrix visual with the corresponding columns from your table(or use the measure as visual level filter with Expand Date for T3 is not blank ). :smileyhappy:
Expand Date for T3 =
VAR minDateSelected = DimDate[min]
VAR maxDateSelected = DimDate[max]
VAR tenDaysPrevious = minDateSelected - 10
VAR tenDaysAfter = maxDateSelected + 10
RETURN
COUNTROWS (
FILTER (
'dpv FactMeteorologyTimeSeries';
'dpv FactMeteorologyTimeSeries'[ForecastTime].[Date]
>= DATE ( YEAR ( 'dpv FactMeteorologyTimeSeries'[ForecastTime].[Date] ); MONTH ( tenDaysPrevious ); DAY ( tenDaysPrevious ) )
&& 'dpv FactMeteorologyTimeSeries'[ForecastTime].[Date]
<= DATE ( YEAR ( 'dpv FactMeteorologyTimeSeries'[ForecastTime].[Date] ); MONTH ( tenDaysAfter ); DAY ( tenDaysAfter ) )
)
)
Regards
thanks v-ljerr-msft, that solved my problem :)