Why does my dax filter show empty values that are not in the filter instead of hiding them?

Viewed 48

I'm trying to filter values from a Column chart :

The chart is like this :

enter image description here

The lightgreen column chart value is from a Measure : Selection Date

And I use a Slicer to filter values like this :

enter image description here

The values are from a table Parametres

enter image description here

So here is my Selection_Date measure :

Selection Date = [DateFilter]

DateFilter is an other measure that choose how to filter the values (based on the slicer's selection).

DateFilter = 

var _today  = TODAY()
var _month  = MONTH(_today)
var _year   = YEAR(_today)
var _last_30_days = _today - 30 

return SWITCH(SELECTEDVALUE(Parametres[Selection_date]),
        "Last30Days", CALCULATE( SUM(v_revenues[qty]), FILTER(v_dates, v_dates[Date] > _last_30_days )),
        "MonthToDate", CALCULATE(SUM(v_revenues[qty]), FILTER(v_dates, v_dates[actual_month] = 1)),
        "YearToDate", CALCULATE(SUM(v_revenues[qty]), FILTER(v_dates, v_dates[actual_year] = 1))
        )

This measure works but I still have one problem. The filter is ok but when I filter a values (example month to date) all the value that are not in the selection (all the values that are not november 2021) are still visible but they are empty :

enter image description here

enter image description here

So here is my question :

How can I add the values that are not in the selection ? How can I filter so it only display the values that are in the checked in the slicer ?

Per example, for Date to Month I want only this to be displayed :

enter image description here

1 Answers

I resolved it by using a Bookmark and then I associated a button to this Bookmark !

Related