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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Tanushree_Kapse
Impactful Individual
Impactful Individual

Current Year Months in Month Slicer

Hello All,,

 

I have a Month slicer, wherein I have pulled Month from the Date hierarchy.
This slicer is showing all the Months from Jan to Dec.
Because I have dates from Jan 2020 till April 2021

In the slicer I just want to show the current year Months... which are Jan to April.

The Top N filter for Year is not working on this.

How can I do that?

Please help!

3 REPLIES 3
Anonymous
Not applicable

You can create a filtered table from your date table containing the dates only for the current year like so 

 

Current year dates = FILTER(Sheet1,Sheet1[Date].[Year] = YEAR(TODAY()))

 

Then you can extract the month from the date using the format function on date 

 

Month Name = FORMAT('Current year dates'[Date],"MMMM")

 

Now when you use this calculated column in your slicer, you'll get only the months present in your date table for the current year dynamically without applying any filters manually as you asked.

 

Aditya_Meshram_1-1627465530117.png

 

Regards,

Aditya

 

 

CNENFRNL
Community Champion
Community Champion

Use a visual level filter

Screenshot 2021-07-27 155055.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

@CNENFRNL , in this case I'll have to manually select the Current Year every time.
Can I not do it dynamically?..the slicer should display current year's months at all times.

 

Thanks!

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.