Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Olaf_Renk
Regular Visitor

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

1 ACCEPTED SOLUTION

Hi @Olaf_Renk ,

 

look at this.

https://community.powerbi.com/t5/Desktop/Date-Filter-default-to-current-day/m-p/835608/highlight/tru...

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


View solution in original post

2 REPLIES 2
v-alq-msft
Community Support
Community Support

Hi, @Olaf_Renk 

 

You may try to modify the FW as follows.

var FW = maxx(TOPN(1;DatumsTabelle;AllSELECTED(DatumsTabelle[FilterKW]);DESC);DatumsTabelle[FilterKW])

 

If I misunderstand your thoughts, please show us you sample data and expected result. Do mask sensitive data before uploading. Thanks.

 

Best Regards

Allan 

Hi @Olaf_Renk ,

 

look at this.

https://community.powerbi.com/t5/Desktop/Date-Filter-default-to-current-day/m-p/835608/highlight/tru...

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors