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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.