- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Creating a filter for the last two weeks of data
I have a client request about displaying a table with the last two weeks (today included) as the default. I have tried messing around with slicers but never managed to have them both work together as one would nee dot be offsetting the other. While searching for options I stumbled upon a possible way around it, creating a custom table with two rows, one being a last two weeks and the other all.
Then a measure was used to calculate such value and turn it into a filter. However, on that formula I'm having issues replacing the generic table/column names. If anyone could point me out in the right direction or have another solution, I'd be thankful.
Below is the measure formula:
Measure = IF(SELECTEDVALUE('Table (3)'[default value])="!previous 45 days",CALCULATE(SUM('Main table'[Value]),FILTER('Calendar',[Date]<=TODAY()&&[Date]>=TODAY()-44)),SUM('Main table'[Value]))
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @AmazingRandom ,
You can use a disconnected dates table and a measure to filter just the last two weeks of dates. This approach if the date column is in a table or used as row header in a matrix is it behaves unexpectedly when used as column header when other dimension columns are added. The other approach is to create a modified table that has a date column and another dates column containing the last two weeks of date referencing the currrent row in the original date column something like below:
Please see attached pbix for your reference.
Dane Belarmino | Microsoft MVP | Proud to be a Super User!
Did I answer your question? Mark my post as a solution!
"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

It is not working for me, I set up the tables but when I apply the filter to my table it returns nothing

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
12-28-2023 02:41 AM | |||
01-22-2024 09:02 AM | |||
07-08-2022 07:17 AM | |||
07-18-2023 04:02 AM | |||
09-07-2023 08:41 AM |
User | Count |
---|---|
140 | |
110 | |
81 | |
60 | |
46 |