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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
LuITS
Helper II
Helper II

Chart with last 30 days, but also show data on slicer select

Hello, 

i have data with a range of over the last 2 years up to today.

 

I have a page with a clustered column chart and a slicer for date column.

I want the chart to display the last 30 days when no date is selected in date slicer, but when a date is selected it should show the data in the chart.

 

I tried relative filter showing the last 30 days which is working. But i want to achive that data also is displayed when i select a date from slicer past those 30 days. 

 

I understand that with the relative date filter, no data is displayed if I select a date that is before the 30 days.
But Is there a way to change this behavior?

 

 

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@LuITS , Create a Disconnected Date Table:

DateTable = CALENDAR(MIN('YourData'[Date]), MAX('YourData'[Date]))

 

Create a Measure for Last 30 Days:

DAX
Last30DaysData =
CALCULATE(
SUM('YourData'[Value]),
FILTER(
'YourData',
'YourData'[Date] >= TODAY() - 30 && 'YourData'[Date] <= TODAY()
)
)

 

Create a Measure for Selected Date Range:

DAX
SelectedDateRangeData =
CALCULATE(
SUM('YourData'[Value]),
FILTER(
'YourData',
'YourData'[Date] IN VALUES('DateTable'[Date])
)
)

 

Combine the Measures:

DAX
FinalData =
IF(
ISFILTERED('DateTable'[Date]),
[SelectedDateRangeData],
[Last30DaysData]
)

 

Use the FinalData measure in your clustered column chart.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

1 REPLY 1
bhanu_gautam
Super User
Super User

@LuITS , Create a Disconnected Date Table:

DateTable = CALENDAR(MIN('YourData'[Date]), MAX('YourData'[Date]))

 

Create a Measure for Last 30 Days:

DAX
Last30DaysData =
CALCULATE(
SUM('YourData'[Value]),
FILTER(
'YourData',
'YourData'[Date] >= TODAY() - 30 && 'YourData'[Date] <= TODAY()
)
)

 

Create a Measure for Selected Date Range:

DAX
SelectedDateRangeData =
CALCULATE(
SUM('YourData'[Value]),
FILTER(
'YourData',
'YourData'[Date] IN VALUES('DateTable'[Date])
)
)

 

Combine the Measures:

DAX
FinalData =
IF(
ISFILTERED('DateTable'[Date]),
[SelectedDateRangeData],
[Last30DaysData]
)

 

Use the FinalData measure in your clustered column chart.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






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.