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
Anonymous
Not applicable

required custom date sllicer Last 7 days,last 15 days,last 30 days

Hi Team,

I have 3 columns 
ID LastUpdateddate Values
1   2020-08-10          100
2   2020-07-12           200
3   2020-08-01            500
4   2020-08-05           700
5    2020-05-15          800
6    2020-07-30          100



I need a date slicer in that i required last7days,last15days,last30 option

once i select last7 days filter , table should display last 7days records only and so on for other option.  

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, I created date to reproduce your scenario. The pbix file is attached in the end. 

 

Table:

b1.png

 

You may create a slicer with 'LastUpdatedDate' and modify the slicer type as 'Relative Date'.

b2.png

Then you may filter the result based on the last n days from totay. Today is 8/11/2020. Here are the results.

b3.png

 

b4.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

View solution in original post

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

Hi, @Anonymous 

 

Based on your description, I created date to reproduce your scenario. The pbix file is attached in the end. 

 

Table:

b1.png

 

You may create a slicer with 'LastUpdatedDate' and modify the slicer type as 'Relative Date'.

b2.png

Then you may filter the result based on the last n days from totay. Today is 8/11/2020. Here are the results.

b3.png

 

b4.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

amitchandak
Super User
Super User

@Anonymous , Check if relative date slicer can work.

https://docs.microsoft.com/en-us/power-bi/visuals/desktop-slicer-filter-date-range

 

Else create slicer like this -

https://community.powerbi.com/t5/Desktop/Slicer-MTD-QTD-YTD-to-filter-dates-using-the-slicer/td-p/500115

 

And use rolling measure -


Rolling 7 days = CALCULATE(sum(Sal[Sales Amount]),DATESINPERIOD('Date'[Date],max(Sales[Sales Date]),-7,Day))


Rolling 14 days = CALCULATE(sum(Sal[Sales Amount]),DATESINPERIOD('Date'[Date],max(Sales[Sales Date]),-14,Day))

 

In case you need to display all dates

https://www.youtube.com/watch?v=duMSovyosXE

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.