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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Generate a table based on slicer

Hi, I have a slicer with random dates, available on my sheet for the user to select a bunch of dates from the dropdown as shown below.
 

EashwarBalaji_0-1675691273671.png


Based on the dates selected by the user, I want to create a table which has a list of dates 30 days prior to the selected date.
For example if I select 16 Dec 2022 and 04 January 2023 on the dropdown, I want my table to have all the dates between 16/11/2022-15/12/2022 and 04/01/2023-03/02/2023. This should update when the user selects a different date.

Is this possible? Thanks in advance!

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , A calculated table can not use a slicer value.

 

if you want to show 30 days trend based on selected value. Create slicer on an independent date table

 

//Date1 is independent Date table, Date is joined with Table
new measure =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = _max -30
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

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.