Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon'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.
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?
Solved! Go to Solution.
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])
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 @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])
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.
To create a rolling calendar in two different ways, you can follow the steps below:
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.
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])
2. Result:
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?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
144 | |
76 | |
63 | |
51 | |
48 |
User | Count |
---|---|
204 | |
86 | |
64 | |
59 | |
56 |