FILTER Function is not working

Hi all,

The user provide 7 sales values through different slicers, one for each day of the week.
Besides, the user also select a ‘Periodo’. (Month&year).

I have created a measure called ‘Daily Sales’ that, using the switch function, assign the right value to each day, which is going fine. It’s also filtered so It only applies the switch function for those dates under the period, which also works fine.
The problem is when creating the visual it shows one row for each Date in the Calendar table, instead of showing JUST the Dates filtered by Periodo). Pleasee see dates 25-04-30-04 with 0 value that should not appear in the visual.

I am working hard to learn FILTER, ALLSELECTED, etc. in the Advanced Dax course. In fact the function FILTER helped me in this way in the other projects with the same error, but unfortunatelly not in this case.
Why is that?


Thanks.

Punto de equilibrio - foro.pbix (374.1 KB)

Hi @juanjo,

First big thanks for supplying a sample file :+1:

This behavior is caused by your SWITCH statement and not the FILTER.
To fix it omit the last parameter in SWITCH that’s the (case else return a) 0…

I hope this is helpful.

2 Likes

So simple… I would not have found it by myself in weeks.

Thanks Melissa, you’re an angel :slight_smile: