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 August 31st. Request your voucher.

Reply
anithaMallam
Helper III
Helper III

need help

Hi All,

          Need your help i have 2 slicers one for year and one for month as shown in the below screenshot.

anithaMallam_0-1623859730665.png

when i select year 2021 the month slicer has to show only till June and for other years selections it  has to show all months.Could someone please let me know how to get this.

 

Regards

Anitha.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @anithaMallam ,

 

You need to create a seperate year table. In the example I used DAX to create a chronology.

Table 2 = DISTINCT('Table'[Date].[Year])

Screenshot 2021-06-21 151525.png

 

Then create the following measure

Measure = var _year=SELECTEDVALUE('Table 2'[Year])
return IF(YEAR(MAX('Table'[Date]))=_year,IF(_year=YEAR(TODAY())&&MAX('Table'[Date])>TODAY(),0,1),0)

Screenshot 2021-06-21 151759.png

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @anithaMallam ,

 

You need to create a seperate year table. In the example I used DAX to create a chronology.

Table 2 = DISTINCT('Table'[Date].[Year])

Screenshot 2021-06-21 151525.png

 

Then create the following measure

Measure = var _year=SELECTEDVALUE('Table 2'[Year])
return IF(YEAR(MAX('Table'[Date]))=_year,IF(_year=YEAR(TODAY())&&MAX('Table'[Date])>TODAY(),0,1),0)

Screenshot 2021-06-21 151759.png

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@anithaMallam , Create a flag in your date table and use this as visual level filter in the month slicer

 

new column

flag = if([Date] <=today(),1,0)

 

filter flag =1

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

Hi Amit,

              Thanks you for helping me.as per your suggestion i created a new column with flag and applied month slicer visual level filter on the flag as shown

anithaMallam_0-1623862145858.png

Still when i select 2021 it is not filtering to june,its showing all the months.

 

Regards

Anitha

 

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.