Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Dynamic Filter by Today's Period/Date

Sample File https://drive.google.com/file/d/1lysTi_VPXBGhGB1WUF05BDdF6DWOxUhE/view?usp=sharing

 

 

I have a date calendar table, and my Sales Table has an "Accounting Period" and "Shipped Date" Column. 

 

I linked the date table date field to the "Shipped date" column in the modeling section.

 

I created an "Is Today" column in the date table with the below formula

 

IsToday =
var currentrowdate = Format('Date'[Date],"mm/dd/yy")
var istoday= format(NOW(), "MM/DD/YY")
Return
IF(istoday=currentrowdate, "Yes", "No")
 
The issue is... I want "today's date" measure (see below) = "Yes" filter to trigger the page being filtered by the "Accounting Period" tied to "today's date"
 
Exp. Today's date is 6/2/22, "today's date" = yes. Yes means to filter the whole page by the "accounting period" = 6. (6/2/22 is in accounting period 6)
 

 

 

I've tried multiple ways around this but I think my brain is officially fried. Any help is appreciated!

 

6 Replies

  • Anonymous ,

    This fine when you want only today

    Is Today = if('Date'[Date]=TODAY(),"Yes","NO")

     

     

    for month till day

     

    Is Today = if('Date'[Date]<=TODAY() && 'Date'[Date]> eomonth(Today(),-1)  ,"MTD","NO")

  • Anonymous's avatar
    Anonymous
    Not applicable

    Since I made today a calculated column, I believe it is only filtering my "Sales" Table by the "Shipped date" row that is "yes" for Today. I want it to Filter the Sales table by "accounting period" where the "shipped date" is "today's date" = yes.

     

    So "Shipped Date" for 2021 P6 is 5/30/31 thru 7/03/2021, "shipped date" for 2022 P6 is 5/29/22- 7/02/22.

     

    I want to dynamically filter a graphic by the period we are in today, based on today's date

     

    Sorry if you answered that, I was just a little confused

  • v-xiaotang's avatar
    v-xiaotang
    Community Support

    Hi Anonymous 

    Your sample file is currently unavailable. What problem are you experiencing now? What is not working as you expected?

     

    Best Regards,

    Community Support Team _Tang

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

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi v-xiaotang, I shared my sample file with you yesterday. I accidently had the privacy settings on. 

       

      Basically, I want the a dynamic filter in the table with my shipment/sales data, that will only filter to rows in our current fiscal month, based on today's date.

       

      So, today 6/09/22 is our fiscal june. All rows with shipment data in june are considered for the values in my vizulization. 

      • v-xiaotang's avatar
        v-xiaotang
        Community Support

        Hi Anonymous 

        Thanks for your reply. (and sorry for my late reply....

        Since the sample is not under import mode, I cannot see data in it...

        >>So, today 6/09/22 is our fiscal june. All rows with shipment data in june are considered for the values in my vizulization. 

        You want to filter the shipped dates in visual by today's date, for example, when today = 6/9/22, you want to get all the shipped dates in June, right? 

         

        Best Regards,

        Community Support Team _Tang

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