Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Dynamic filter for current month

Hello everyone,
I would like to know if there is any way to create a dynamic page filter so that whenever someone opens my PowerBI web dashboard, all the charts automatically adapt to the current month's data?

  • Anonymous's avatar
    Anonymous
    6 years ago

    yeah, 

     

    Drag your date to the Filters on to the all pages filters. 

     

    change to relative date> Show items when the values is in this month 

     

     

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    yeah, 

     

    Drag your date to the Filters on to the all pages filters. 

     

    change to relative date> Show items when the values is in this month 

     

     

    • slightlym's avatar
      slightlym
      New Member

      Do I understand correctly that this solution would work only with Direct Query?

  • Anonymous's avatar
    Anonymous
    Not applicable

    Yes, add a calculated column to your table:

    IsCurrentMonth = 
        IF (
            YEAR ( Table1[Create Date] ) = YEAR ( TODAY () )
                && MONTH ( Table1[Create Date] ) = MONTH ( TODAY () ),
            "Yes",
            "No"
        )

    Then use this column as a page level filter: where IsCurrentMonth = "Yes" 

  • Anonymous , have a column like this in your date table

    Month Type = Switch( True(),
    eomonth([Date],0) = eomonth(Today(),-1),"Last Month" ,
    eomonth([Date],0)= eomonth(Today(),0),"This Month" ,
    Format([Date],"MMM-YYYY")
    )

     

    Select this month and save,

     

    make sure is sorted on a column like

    Format([Date],"YYYYMM")