Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

apply current month to visual filter

 

i have a monthly filter for the table view for which "require single selection" is enabled. The values in it are in the format "Month Year" (january 2021, february 2021 etc). So is there any option by which the filter defaults to the current month (ie june 2021 fr now) according to the prese date

 

  • Fowmy's avatar
    Fowmy
    5 years ago

    Anonymous 

     

    It is not possible yet, please click the link I shared and vote for this feature to be included 

     

     

6 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi 
    Do you have date slicer ? 
    If yes try to add relative month like below example

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      this doesnt wrk 😕
      we need the current month to be selected as default and also an option for the user to view other reports by selecting a month

      • Fowmy's avatar
        Fowmy
        Icon for Super User rankSuper User

        Anonymous 

         

        It is not possible yet, please click the link I shared and vote for this feature to be included 

         

         

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous 

    I think you want to filter your visual to the current month when there is no selection in your “Month Year” filter.

    You can try to build a filter measure to achieve your goal.

    My Sample:

    Filter Measure:

     

    Filter Measure =
    VAR _CurMonthYear =
        FORMAT ( TODAY (), "MMMM" ) & " "
            & YEAR ( TODAY () )
    VAR _RESULT =
        IF (
            ISFILTERED ( 'Sample'[Month Year] ),
            1,
            IF ( MAX ( 'Sample'[Month Year] ) = _CurMonthYear, 1, 0 )
        )
    RETURN
        _RESULT

     

    Add this measure into visual filter field and set it to show items if the value equal to 1. We can see that our visual will only show values whose "Month Year" = June 2021 by default.

    If we filter in "Month Year",result is as below.

    Best Regards,

    Rico Zhou

     

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

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      hi Anonymous  thanks fr the idea. 
      But our report has future dates too !

      so we cant check this condition in that measure 😞