Forum Discussion

micklowe's avatar
micklowe
Icon for Helper I rankHelper I
1 year ago
Solved

Today less 12 months

Hi    I'm trying to build a report to show data for the last 12 months from today. I don't need any slicers just a screen showing the visuals.   I've tried using: RollingTickets = CALCULATE(DIS...
  • SolomonovAnton's avatar
    1 year ago

    To get a dynamic rolling 12-month period ending today, you should adjust your DAX to explicitly use TODAY() instead of relying on MIN() or MAX() from the calendar, which are context-dependent. Here’s how you can rewrite your measure:

    RollingTickets = 
    CALCULATE(
        DISTINCTCOUNT(wh_task[task_id]),
        DATESBETWEEN(
            Calendar[Date],
            EDATE(TODAY(), -11),
            TODAY()
        )
    )

    Explanation:

    • TODAY() ensures the end date is always current.
    • EDATE(TODAY(), -11) goes back 11 months, and since it includes the full current month, it results in a 12-month window.

    Additional Tips:

    • Ensure your Calendar[Date] column has a complete date range including today.
    • This measure will auto-update as time progresses, perfect for static visuals without slicers.

    Try this measure in your visual and confirm it shows the correct rolling 12-month count dynamically.

    ✔️ If my message helped solve your issue, please mark it as Resolved!

    👍 If it was helpful, consider giving it a Kudos!

  • johnt75's avatar
    1 year ago

    You can try

    RollingTickets =
    CALCULATE (
        DISTINCTCOUNT ( wh_task[task_id] ),
        DATESBETWEEN ( Calendar[Date], EDATE ( TODAY (), -11 ), TODAY () )
    )
    

    You might want to use TODAY() - 1 in both instances, depending on when your data refreshes.