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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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