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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
deepguptaac
Frequent Visitor

Custom anchor dates for relative date filter for a page

Hi folks, 

 

I am preparing a sales report in which I need week on week progress of sales. In this report, I want to show sales of last 12 weeks which can be achived by using relative date filter for the page.

 

However in my case I want to add a slicer by which custom date can be selected and user can see weekly progression of sales of last 12 weeks from that selected slicer.

Please help me in case there is a easy solution for such.

deepguptaac_0-1676538675095.png

Sample of final report is as in the picture.

1 REPLY 1
amitchandak
Super User
Super User

@deepguptaac , if you select a date an then want 12 week trend, the slicer need to be on an independent table

 

//Date1 is independent Date table, Date is joined with Table
new measure =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = _max -weekday(_max,2) + 1  -12*7
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))

 

Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI

 

Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...
https://www.youtube.com/watch?v=pnAesWxYgJ8

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors