Forum Discussion

theyk's avatar
theyk
Regular Visitor
4 years ago
Solved

Create Monthly reports with Dynamic dateTime filter

I have an orders dataset, where I have the following fields   order_datetime  order_id settlement_datetime amount country order_type   I wanted to create a subscription so that on 15th of ev...
  • YukiK's avatar
    YukiK
    4 years ago

    Then this should do it:

     

    Your table =

    VAR __FirstDayOfThisMonth = DATE(YEAR(TODAY()), MONTH(TODAY()), 1)
    VAR __FirstDayOfLastMonth = EDATE ( DATE(YEAR(TODAY()), MONTH(TODAY()), 1), 1)

    RETURN
    FILTER (
    financials,
    AND (
    financials[Date] >= __FirstDayOfLastMonth,
    financials[Date] <= __FirstDayOfThisMonth
    )
    )

     

    Hope that helps!