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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Default and filtered values by date

Hi all, I need to filter my Table (visual level) as follows:

 

When nothing is selected in date slicer table displays data for  last 30 days (excluding today) and whenever anytihng is selected in slicer it would filter accordingly to slicer selection.

 

Can you advice how to implement this logic and apply it on my table ?

3 REPLIES 3
v-zhenbw-msft
Community Support
Community Support

Hello @aleksandra_stan ,

It cannot be achieved without a measure, so we can create a date table and a measure to meet your needs.

1. Create a date table that has no relationship between the original table. Create the slicer with this table.

Date table = CALENDAR("2020/1/1","2020/12/31")

D1.jpg

2. Then we can create a measure.

Measure = 
var _today = TODAY()
var _last30day = _today - 30
return
IF(
    HASONEFILTER('Date table'[Date]),
    CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Date]=SELECTEDVALUE('Date table'[Date]))),
    CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Date]>_last30day && 'Table'[Date]<=_today)))

D2.jpg

D3.jpg

If you don't meet your requirements, could you show the exact expected result based on the table we shared?

Best regards

Community support team _ zhenbw

If this post helps,then consider Accepting it as the solution to help other members find it faster.

BTW, pbix as an attachment.

amitchandak
Super User
Super User

@Anonymous , Try like

measure =
var _max = maxx(allselected(Date),Date[Date])
var _min = maxx(allselected(Date),Date[Date])-30
return
if(isfilter(Date[Date]), [Measure], calculate([Measure],filter(Date, Date[Date] >=_min && Date[Date] <=_max)))

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

Thank you, @amitchandak ,

 

but I do not have any measures. I am displaying the entire table/columns as it is . Is there a way to filter it without measure or I still should create measures for the columns I am displaying as values ?

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors