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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Current Year month as default selction, also keep

Hello All,

 

I have a "year month" Slicer. Every month my data gets updated and  I want slicer to be auto-selected for all current year and month, but also have previous year month unselected.

 

I have created a calculated column as 

Column = IF(MONTH(Table1[Date])=MONTH(NOW()) && YEAR(Table1[Date])=YEAR(NOW()),"current month",MONTH(Table1[Date]))

 

and kept in under visual filter, it shows only current year and month, the previous year month doesn't appear at all.

I want current year month autoselected and previous unselected

 

Thanks,

Aditya

 

4 REPLIES 4
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Calculated column is static, you could create a measure which changes dynamically every year.

Measure = IF(YEAR(MAX(Sheet1[date]))=YEAR(TODAY()),1,0)

Capture9.JPG

If you want to aotu select the slicer dynamically, it seems impossible.

 

Best Regards

Maggie

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

I have created calculated column and selected current year, but other years doesn't appear in the drop-down,

 

My requirement is : I want current year month to be selected but other year month should be unselected.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.