cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Resolver II

## Date dimension table with rolling 13 months

I'm trying to create a date table which only goes back as far as the last 13 calendar months from today and my code does not work, can you show me where i'm going wrong?

Date = CALENDAR(DATE(MONTH(TODAY()-13),1,1),TODAY())

1 ACCEPTED SOLUTION
Resolver II

I found a simpler solution which corrected my original syntax
Date = CALENDAR(DATE(YEAR(TODAY()),MONTH(TODAY())-13,DAY(TODAY())),today())

6 REPLIES 6
Community Champion

Try:

``````13 months Cal =
VAR _Today =
TODAY ()
VAR __13Months =
DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ) - 13, DAY ( TODAY () ) )
RETURN
CALENDAR ( __13Months, _Today )
``````

In doing so, you are also helping me. Thank you!

Proud to be a Super User!

Resolver II

I found a simpler solution which corrected my original syntax
Date = CALENDAR(DATE(YEAR(TODAY()),MONTH(TODAY())-13,DAY(TODAY())),today())

Solution Sage

Interesting solution. I didn't know that using Date() would automatically change the year based on the subtraction of the months 🙂

Solution Sage

Resolver II

@JorgePinho it says DATEADD must specify a column

Solution Sage

Create a Last Refresh column for your report and use that column.

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

#### Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors