Forum Discussion

cwayne758's avatar
cwayne758
Helper IV
10 years ago
Solved

Create Previous Week Filter?

How would I go about creating a Previous Week filter in DAX? 

 

Pretty straightforward, trying to capture a snapshot of business only in the previous week of that Year.

 

 

Below is the logic in my Access database

 

 IIf(DatePart("ww",[SALES].[DATE_ENTERED])=DatePart("ww",Date())-1,"PREVIOUS",Null)

19 Replies

    • cwayne758's avatar
      cwayne758
      Helper IV

      Thank you very much for your response PowerBIGuy. Unfortunately, I do not think this solution is working for my particular case (or I am mistakenly doing something) 

       

      Below is my usage of your suggestion.

       

      I'm trying to create a column that lists each date as within the "Previous Week", if not, "Null"

       

      Date Filter.PNG

      Thank you again for your suggestions!

      • PowerBIGuy's avatar
        PowerBIGuy
        Responsive Resident

         

         

         Maybe it's your data model. my example uses a date dim. Sorry it didn't work out.

         

         

        Capture.JPG

         

         

  • For the future reader, the date filter now has a "calendar week" option so it looks like this has been addressed.