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
NavaneethaRaju
Helper IV
Helper IV

From Jan to October Month only have to show in slicer for 2021 Year

Hi , 

 

I using two slicer, one for year and another one for month, if i select 2021 year, the month slicer only have to show upto october month, because 2021 November and december values(Sales) not added. Kindly advice how to create a slicer while select 2021 year and month upto october.

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

Hi @NavaneethaRaju ,

You can create a measure like this, put it in the month visual filter and set its value as 1:

A = 
IF (
    SELECTEDVALUE ( 'Table'[Date].[Year] ) = YEAR ( TODAY () ),
    IF ( MAX ( 'Table'[Date].[MonthNo] ) <= MONTH ( TODAY () ), 1, 0 ),
    1
)

vyingjl_0-1634261712681.pngvyingjl_1-1634261721490.png

 

Best Regards,
Community Support Team _ Yingjie Li
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

4 REPLIES 4
v-yingjl
Community Support
Community Support

Hi @NavaneethaRaju ,

You can create a measure like this, put it in the month visual filter and set its value as 1:

A = 
IF (
    SELECTEDVALUE ( 'Table'[Date].[Year] ) = YEAR ( TODAY () ),
    IF ( MAX ( 'Table'[Date].[MonthNo] ) <= MONTH ( TODAY () ), 1, 0 ),
    1
)

vyingjl_0-1634261712681.pngvyingjl_1-1634261721490.png

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Hi, @v-yingjl ,

 

I'm getting error, using now.

NavaneethaRaju_0-1635494590817.png

 

And one thing in your measure You used the column [monthNo], that is not in your table. please check and advice.

 

Your Measure.

NavaneethaRaju_1-1635494657443.png

 

Your table.

NavaneethaRaju_2-1635494665278.png

 

 

 

Sai4237
Frequent Visitor

Create the following Measure :

Slicer_filter =
INT (
NOT ISEMPTY ("Sales Table" )
)
Use this Measure on the Month Slicer and put it on Visual level Filter and set it to 1.

Sai4237_0-1634019414851.png

This gives only those months have sales in your Sales Table.

 

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

Appreciate your Kudos!!

 

VahidDM
Super User
Super User

Hi @NavaneethaRaju 

 

Create a measure with this code:

Measure = if(max('Date'[Date])<=today()+30,1,blank())
 
Then add that to the filter pane to filter your month slicer and set it to is not blank.
 
VahidDM_1-1633954971955.png

 

 

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

Appreciate your Kudos!!

 

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.

Top Solution Authors