Forum Discussion

Olaf_Renk's avatar
Olaf_Renk
Regular Visitor
6 years ago
Solved

Slicer - Default Filter not working

Hello,

i am trying to create a report, which is always filtered with the data of the last week.

For this I use a measure which gives me the number of the last week, depending on today.

This LastWeek-measure is built into all my measures and works.

Now I want to add a slicer, so that the user can see older weeks. This is where my problems start.

Everything I have tried leads to the fact that the results of my measures always refer to all data, if nothing is filtered in the slicer. If I filter in the slicer I see the correct data.

What is going wrong?

If I create the measure LastWeek as follows it works without slicer for the last week.

 

 

 

LastWeek = LOOKUPVALUE(DatumsTabelle[ISO Week Number];DatumsTabelle[Date];TODAY())-1

 

 

 

If I want to work with IF() now, then I always have the problem, because without filtering all data is used, but not the data for last week.

 

 

LastWeek = 
var LW = LOOKUPVALUE(DatumsTabelle[ISO Week Number];DatumsTabelle[Date];TODAY())-1
var FW = maxx(TOPN(1;DatumsTabelle;DatumsTabelle[FilterKW];DESC);DatumsTabelle[FilterKW])
RETURN
IF(ISFILTERED(DatumsTabelle[FilterKW]);FW;LW)

 

 

I use my own Date table with ISO Week and FilterWeek

 

What do I want to achieve?
When the report is called up, it automatically looks at the last week.
If the user selects another week, then this one accordingly.

 

Thank for Help

Olaf

2 Replies