Forum Discussion

kasife's avatar
kasife
Icon for Helper V rankHelper V
3 years ago

Filter last 3 months

Hi people,

Guys, I'm trying to bring values from the last 3 months into a matrix and for that I used this filter

 

I filter the last 2 months and include today because I need the current month, but it is not returning the 3rd month. How can I solve? I need to view the current month + the last 2

 

  

 

 

 

 

15 Replies

    • kasife's avatar
      kasife
      Icon for Helper V rankHelper V

      parry2k toribiolmSXP Thank you for returning
      I noticed that if I put 3 months it calculates the period below

      I've been testing to put it in days and it seems to have worked, but I'm not sure it can work over the months

       

       



       

       

  • kasife this is really strange, can you share pbix file, and remove sensitive information before sharing.

  • toribiolmSXP's avatar
    toribiolmSXP
    Frequent Visitor

    Hi Kasife, what are the date values you have in your Date column? if you have there only one day of the month and is not within the filter context created by the 'Last 3 months' filter in your screenshot it wont show any date. i.e. if you have the 20 of each month in that column, the 20.06.2023 won't be included.

    • kasife's avatar
      kasife
      Icon for Helper V rankHelper V

       

      toribiolmSXP What I did was use the calendar day in the segmentation

      Because I would like to select a period, for example, from the 1st to the 23th of each month (last 3 months)

      I have data on every day of the month.

       

      • toribiolmSXP's avatar
        toribiolmSXP
        Frequent Visitor

        Hi Kasife,

        The date filter looks correct so I would start by hovering the mouse on the visual where June 2023 does not show any data and check in the funnel icon on that visual what filters are applied (just in case there is some other filter preventing this data to show).

         

        You can also add the day to the visual and review the data in table view, so you can double check what days are included.

  • kasife the reason it is not working is because you didn't mark the calendar table as a date table. Once you do that, everything will work.

     

    As a best practice, add a date dimension in your model and use it for time intelligence calculations. Once the date dimension is added, mark it as a date table on table tools. Check the related videos on my YT channel

     

    Learn why marking a Date dimension as date table is critical to use DAX Time Intelligence functions - YouTube

    Add Date Dimension
    Importance of Date Dimension
    Time Intelligence Playlist

     

    • kasife's avatar
      kasife
      Icon for Helper V rankHelper V

       

      parry2k  I did as you suggested, but the segmentation transforms period between dates. I need to filter a period by days. For example, from the 1st to the 10th of August, from the 1st to the 10th of July, and from the 1st to the 10th of June. Always the same periods for the last 3 months

       

       

    • kasife's avatar
      kasife
      Icon for Helper V rankHelper V

      parry2k I just watched it but I really don't know how to implement it to get the result I need