Forum Discussion

SachinC's avatar
SachinC
Helper V
7 years ago

Date Filtering using dates until today's date

Hi,

I have a PowerBI visual that uses relative date filtering, i.e. In This Month which covers 01/06/2019 to 30/06/2019.

However, what I need is this month upto the date it is viewed. Example, if today is 19/06/2019, then I want the filter to be 01/06/2019 to 19/06/2019.  

Please help?
Thanks.

1 Reply

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

    Hi SachinC 

     

    I’ve created a sample with the date from May 20 to June 24 as below, we can achieve the result filtered by the dates in the same month till today using the measure :

    Measure = var today = TODAY()

    var tm = MONTH(TODAY())

    var ty = YEAR(TODAY())

    Return

    IF(MAX([Date])<=today&&MONTH(MAX([Date]))=tm&&YEAR(MAX([Date])=ty),1,0)

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    And then filter the measure by “1”:

     

     

     

     

     

     

     

     

     

     

     

    Regards,

    Dina