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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
alsm
Helper III
Helper III

Filter one date slicer based on another date slicer

This question seemed to have been asked many times and the answer was not what I as looking for.

In order to help others I am posting this as a show and tell.

The problem statement is that I have a date slicer created from a date table and I want to filter another date slicer to dates between this selected range only.

Slicer ->

alsm_2-1701786544329.png

Date Table ->

alsm_1-1701786426777.png

Now I want to limit another date range from above date slicer i.e. in this example between 13/11/2023 and 26/10/2023

alsm_3-1701786680270.png

 

Here is 'my' solution (sure there are better ones out there and happpy to learn) based on ideas from other similar solution:

1. Create a duplicate of Dates table called 'Compare Dates'

alsm_4-1701786784734.png

2.  Write following measures

 

MaxSelectDate = MAX(Dates[Date])
MinSelectDate = MIN(Dates[Date])
CompareDateFilter = if( MAX('Compare Dates'[Compare Date]) < [MaxSelectDate] && MIN('Compare Dates'[Compare Date]) >= [MinSelectDate] ,1)

 

MaxSelectDate and MinSelectDate are based on 'Dates' table while CompareDateFilter is based on 'Compare Dates' table

Add this measure into Filter 

alsm_5-1701787048828.png

and voila you see 'compare date' is filtered 😊.

 

How do I use it?

I create a following measures for example:

 

MV Select Date = 
VAR _rptDt = Max(Dates[Date]))
RETURN CALCULATE(SUM(MarketValue[Market Value]),MarketValue[RefDtAsDate] = _rptDt)
MV Compare Date = 
VAR _rptDt = SELECTEDVALUE('Compare Dates'[Compare Date]) 
RETURN CALCULATE(SUM(MarketValue[Market Value]),MarketValue[RefDtAsDate] = _rptDt)

 

and add it into matrix

alsm_6-1701787451635.png

and compare between any two dates of my choice

Note: The first slicer with date range I use for showing trend using line chart between the selected dates and the second 'Compare Date' slicer I can compare numbers with any of the selected date in between.

 

Hope it helps.

Happy to learn how other ways people have implemented this

2 REPLIES 2
alsm
Helper III
Helper III

@lbendlin , yes user wanted two date slicers to compare data between dates of their choice

lbendlin
Super User
Super User

What's the actual problem you are trying to solve?  Is that something your users complained about?

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.

Top Solution Authors