Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hi all,
I'm trying to created a date table, where each row is equal to one month, like:
January 2023
February 2022
March 2022
I've tried a number of methods for this but I can't seem to figure it out. For example, CALANDERAUTO() gives me a row for each day, rather than a row for each month as per below:
Any help would be greatlly appreciated!
Thanks
Solved! Go to Solution.
Hi @Anonymous
You can refer to the following example.
Create a new table
Table = var a=ADDCOLUMNS(CALENDAR(DATE(2022,1,1),DATE(2023,1,1)),"Month Year",FORMAT([Date],"yyyy mmmm"))
return SUMMARIZE(a,[Month Year])
Then change the data type to date, and the format to "mmmm yyyy"
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
You can refer to the following example.
Create a new table
Table = var a=ADDCOLUMNS(CALENDAR(DATE(2022,1,1),DATE(2023,1,1)),"Month Year",FORMAT([Date],"yyyy mmmm"))
return SUMMARIZE(a,[Month Year])
Then change the data type to date, and the format to "mmmm yyyy"
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
You can create a blank query and paste this code to generate desired results.
Please change the range as per your requirement.
----------------------------------
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMtQ31DcyMDRQio0FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [StartDate = _t]),
#"Changed column type" = Table.TransformColumnTypes(Source, {{"StartDate", type date}}),
#"Added custom" = Table.AddColumn(#"Changed column type", "EndDate", each "12/31/2025"),
#"Changed column type 1" = Table.TransformColumnTypes(#"Added custom", {{"EndDate", type date}}),
#"Added custom 1" = Table.AddColumn(#"Changed column type 1", "Date", each {Number.From([StartDate])..Number.From([EndDate])}),
#"Expanded Date" = Table.ExpandListColumn(#"Added custom 1", "Date"),
#"Changed column type 2" = Table.TransformColumnTypes(#"Expanded Date", {{"Date", type date}}),
#"Removed Columns" = Table.RemoveColumns(#"Changed column type 2",{"StartDate", "EndDate"}),
#"Calculated Start of Month" = Table.TransformColumns(#"Removed Columns",{{"Date", Date.StartOfMonth, type date}}),
#"Removed Duplicates" = Table.Distinct(#"Calculated Start of Month")
in
#"Removed Duplicates"
hi @Anonymous
try to add a column like this:
hi @Anonymous
or you wanna create a table from scratch, like this:
DateTable =
ADDCOLUMNS(
CALENDAR(DATE(2022,12,30), DATE(2023,1,1)),
"MonthYear", FORMAT([Date], "MMMM YYYY"),
"MonYear", FORMAT([Date], "MMM YYYY")
)
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 3 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 11 | |
| 9 | |
| 8 | |
| 7 | |
| 6 |