Forum Discussion

ta19's avatar
ta19
Regular Visitor
4 years ago
Solved

Dates in Power BI while filtering

Hello, 

So I am trying to filter one of my Table Columns using New Measure. But I am also trying to include specific date for this column. For the first column i am filtering it needs to pull yestrdays date. I have two other columns that I am filtering as well, but they need to filter for todays date and other is for tomorrows date. 

 

Here is an example of what i am trying to do, but I am trying to filter it for yesterdays date (how can I include that date filter here in the code?):

 

Requests Recieved = Countrows(filter(Table1,Table1[ANum] && Table1[status]="Active" && Table1[MovementTypeCode]="Transfer"))

 

Any help would be appericated! Thank you!

  • Hi, ta19 ;

    May be :

    Requests Recieved =
    COUNTROWS (
        FILTER (
            Table1,
            Table1[ANum]
                && Table1[status] = "Active"
                && Table1[MovementTypeCode] = "Transfer"
                && [Request Date]
                    = TODAY () - 1
        )
    )
    

    I don’t really understand what you mean, Could you please considier sharing some scenes and expected result so it is clear on what needs?
    And It would be great if there is a sample file without any sesentive information here.
    It makes it easier to give you a solution.


    Best Regards,
    Community Support Team_ Yalan Wu


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

3 Replies

  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Community Support

    Hi, ta19 ;

    May be :

    Requests Recieved =
    COUNTROWS (
        FILTER (
            Table1,
            Table1[ANum]
                && Table1[status] = "Active"
                && Table1[MovementTypeCode] = "Transfer"
                && [Request Date]
                    = TODAY () - 1
        )
    )
    

    I don’t really understand what you mean, Could you please considier sharing some scenes and expected result so it is clear on what needs?
    And It would be great if there is a sample file without any sesentive information here.
    It makes it easier to give you a solution.


    Best Regards,
    Community Support Team_ Yalan Wu


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

  • ta19's avatar
    ta19
    Regular Visitor

    Forgot to mention that the columns name in my table is called "Request Date" that i need to use to filter out the dates. 

  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Community Support
    Hi, ta19 ;
    Is your problem solved? If so, Would you mind accept the helpful replies as solutions? Then we could close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.

    Best Regards,
    Community Support Team_ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.