Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
jayasurya_prud
Helper II
Helper II

how to create a Rolling Calendar of 6 Years with the interval of 2 months?

I am working on a report where I am trying to create a rolling calender in 2 ways.

 

1. As a different table

2. As a column in an existing table

 

The rolling calender is for 6 years with the interval of 2 months

 

ex:

03/01/2022  

05/01/2022

07/01/2022

09/01/2022

 

How to execute this?

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @jayasurya_prud ,

 

You can change the date of Dax inside to 3/1/2022 and "12/31/2028"

MonthTable =
var FullCalendar =
ADDCOLUMNS(
CALENDAR("2022/3/1","2028/12/31"),"Month Number",MONTH([Date]),
"Year",YEAR([Date]),
"Year-Month",VALUE(LEFT(FORMAT([Date],"yyyyMMdd"),6)),
"Month Name",FORMAT(MONTH([Date]),"MMM"),"Year-MonthName",
YEAR([Date]) & " " & FORMAT(MONTH([Date]),"MMM"))
var _table1=
SUMMARIZE(FullCalendar,[Year-Month])
var _table2=
FILTER(
    _table1,
   MOD( ([Year-Month] - MINX(_table1,[Year-Month])),2) =0)
var _table3=
ADDCOLUMNS(
    _table2,"Date",DATE(LEFT([Year-Month],4),RIGHT([Year-Month],2),1))
return
SUMMARIZE(_table3,[Date])

vyangliumsft_0-1682671219206.png

 

Best Regards,

Liu Yang

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

View solution in original post

4 REPLIES 4
v-yangliu-msft
Community Support
Community Support

Hi  @jayasurya_prud ,

 

You can change the date of Dax inside to 3/1/2022 and "12/31/2028"

MonthTable =
var FullCalendar =
ADDCOLUMNS(
CALENDAR("2022/3/1","2028/12/31"),"Month Number",MONTH([Date]),
"Year",YEAR([Date]),
"Year-Month",VALUE(LEFT(FORMAT([Date],"yyyyMMdd"),6)),
"Month Name",FORMAT(MONTH([Date]),"MMM"),"Year-MonthName",
YEAR([Date]) & " " & FORMAT(MONTH([Date]),"MMM"))
var _table1=
SUMMARIZE(FullCalendar,[Year-Month])
var _table2=
FILTER(
    _table1,
   MOD( ([Year-Month] - MINX(_table1,[Year-Month])),2) =0)
var _table3=
ADDCOLUMNS(
    _table2,"Date",DATE(LEFT([Year-Month],4),RIGHT([Year-Month],2),1))
return
SUMMARIZE(_table3,[Date])

vyangliumsft_0-1682671219206.png

 

Best Regards,

Liu Yang

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

Adamboer
Responsive Resident
Responsive Resident

To create a rolling calendar in two different ways, you can follow the steps below:

  1. As a different table:
  • Click on the "Modeling" tab in the ribbon menu and then select "New Table".
  • In the formula bar, enter the following formula:
    RollingCalendar = CALENDAR(DATE(2022, 3, 1), DATE(2028, 2, 1))
    • This formula will create a new table called "RollingCalendar" with a range of dates from March 1, 2022, to February 1, 2028, with an interval of two months.
    1. As a column in an existing table:
    • Select the existing table in which you want to add the rolling calendar column.
    • Click on the "Modeling" tab in the ribbon menu and then select "New Column".
    • In the formula bar, enter the following formula:

      RollingCalendar = CALENDAR(DATE(2022, 3, 1), DATE(2028, 2, 1), "MONTH")

      • This formula will create a new column called "RollingCalendar" in the selected table with a range of dates from March 1, 2022, to February 1, 2028, with an interval of two months.

      Once you have created the rolling calendar, you can use it in your report by selecting it as a data source or by adding it to your existing tables using a relationship.







v-yangliu-msft
Community Support
Community Support

Hi  @jayasurya_prud ,

 

Here are the steps you can follow:

1. Create calculated table.

MonthTable =
var FullCalendar =
ADDCOLUMNS(
CALENDAR("2022/3/1","2022/12/31"),"Month Number",MONTH([Date]),
"Year",YEAR([Date]),
"Year-Month",VALUE(LEFT(FORMAT([Date],"yyyyMMdd"),6)),
"Month Name",FORMAT(MONTH([Date]),"MMM"),"Year-MonthName",
YEAR([Date]) & " " & FORMAT(MONTH([Date]),"MMM"))
var _table1=
SUMMARIZE(FullCalendar,[Year-Month])
var _table2=
FILTER(
    _table1,
   MOD( ([Year-Month] - MINX(_table1,[Year-Month])),2) =0)
var _table3=
ADDCOLUMNS(
    _table2,"Date",DATE(LEFT([Year-Month],4),RIGHT([Year-Month],2),1))
return
SUMMARIZE(_table3,[Date])

vyangliumsft_0-1682561748745.png

2. Result:

vyangliumsft_1-1682561748748.png

 

Best Regards,

Liu Yang

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

Hi Liu Yang!

thanks for taking time and helping me out. The solution partially helps. 

I want the same for 6 years like 2022 to 2028

how to get that?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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