Forum Discussion
filter does not work when columns are not selected
- 1 year ago
that is not working. finally i find the correct code:
filter_dates_general =
VAR SelectedStartDate = MIN(dim_calendar[Date])
VAR SelectedEndDate = MAX(dim_calendar[Date])
RETURN
CALCULATE(
DISTINCTCOUNT(fct_revenu[DIM_Customer_ID]),
KEEPFILTERS(
(fct_revenu[Start_Date] >= SelectedStartDate && fct_revenu[Start_Date] <= SelectedEndDate) ||
(fct_revenu[End_Date] >= SelectedStartDate && fct_revenu[End_Date] <= SelectedEndDate) ||
(fct_revenu[Start_Date] <= SelectedStartDate && fct_revenu[End_Date] >= SelectedEndDate)
)
)
that is not working. finally i find the correct code:
filter_dates_general =
VAR SelectedStartDate = MIN(dim_calendar[Date])
VAR SelectedEndDate = MAX(dim_calendar[Date])
RETURN
CALCULATE(
DISTINCTCOUNT(fct_revenu[DIM_Customer_ID]),
KEEPFILTERS(
(fct_revenu[Start_Date] >= SelectedStartDate && fct_revenu[Start_Date] <= SelectedEndDate) ||
(fct_revenu[End_Date] >= SelectedStartDate && fct_revenu[End_Date] <= SelectedEndDate) ||
(fct_revenu[Start_Date] <= SelectedStartDate && fct_revenu[End_Date] >= SelectedEndDate)
)
)