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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
salexa
Helper II
Helper II

Show date values in slicer for selected MonthYear and before

Hi,

 

I have a table with columns for Date Contract and Date Deliver as in the example below:

Date ContractDate DeliverID
1/09/2019 1
5/10/2019 2
9/10/2019       27/10/20193
1/11/20191/11/20194
1/12/20195/12/20195

I want to able able create a MonthYear slicer and when I select a month, eg Oct2019, to have another slicer for Date Contract that will display only the date values for Oct2019and before(1/09/2019,5/10/2019 and 9/10/2019) and another slicer for Date Deliver taht will display date values for Oct and after(27/10/2019/01/11/2019/05/12/2019).

 

I can't figure out the dax formula for it, I've tried to cerate a measure with if an selectedvalue but no luck so far.

 

Thanks!

1 ACCEPTED SOLUTION
tex628
Community Champion
Community Champion

Take a look at the attached file. 

Generally you are going to want to have atleast 1 completly unrelated calendar table that you will use as a slicing table. This is going to act as the source for the plain Year/month slicer. 

The idea is to use 2 different measure, like the ones in my demo file to get the selected date/yearmonth and then use that as a visual level filter on the other two slicers. 

Take a look and let me know how it goes!

Br,
J


Connect on LinkedIn

View solution in original post

5 REPLIES 5
tex628
Community Champion
Community Champion

Take a look at the attached file. 

Generally you are going to want to have atleast 1 completly unrelated calendar table that you will use as a slicing table. This is going to act as the source for the plain Year/month slicer. 

The idea is to use 2 different measure, like the ones in my demo file to get the selected date/yearmonth and then use that as a visual level filter on the other two slicers. 

Take a look and let me know how it goes!

Br,
J


Connect on LinkedIn

it's working, thanks.

I just updated a litle bit the formula for over, to take in consideration also teh dates for the selected month when using a filter YearMonth

 

Thanks

amitchandak
Super User
Super User

@salexa , Create an independent date slicer and use that in measure

Measure 2 =
var _max = maxx(allselected('Date') , 'Date'[Date])
var _min = minx(allselected('Date') , 'Date'[Date])
return
calculate(countrows('Table'), Filter(all('Table'), 'Date'[Date Contract] <=_max && 'Date'[Date Deliver] >=_min ))

 

or

 

Measure =
var _max = maxx(allselected('Date') , 'Date'[Date])
var _min = minx(allselected('Date') , 'Date'[Date])
return
calculate(countrows('Table'), Filter(all('Table'), 'Date'[Date Contract] <=_max ))

Measure 1=
var _max = maxx(allselected('Date') , 'Date'[Date])
var _min = minx(allselected('Date') , 'Date'[Date])
return
calculate(countrows('Table'), Filter(all('Table'), 'Date'[Date Deliver] >=_min ))

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
tex628
Community Champion
Community Champion

Just making sure i understadn the requirement. 

You want 3 slicers. 

One plain Year/Month. 

One slicing contract date. Showing the selected month and every date before that. 

One slicing delivery date. Showing the selected month and every date after that.

Am i correct? 

/ J


Connect on LinkedIn

yes, you've summed up correctly my need

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 Kudoed Authors