Forum Discussion
pierre415
9 years agoHelper I
Calendar w/ months interval
I need to build a date table with months as intervals instead of days, as in - Jan 2017 Feb 2017 March 2017 . . . (today's month/year) I tried using List.Dates() but I think the biggest...
- 9 years ago
I assuem you assign start date and end date. Then you can create a calculated table with DAX. Please refer to my sample below:
MonthTable = var FullCalendar = ADDCOLUMNS(CALENDAR("2016/1/1","2017/12/31"),"Month Number",MONTH([Date]),"Year",YEAR([Date]),"Year-Month",LEFT(FORMAT([Date],"yyyyMMdd"),6),"Month Name",FORMAT(MONTH([Date]),"MMM"),"Year-MonthName",YEAR([Date]) & " " & FORMAT(MONTH([Date]),"MMM")) return SUMMARIZE(FullCalendar,[Month Number],[Year],[Year-Month],[Year-MonthName])Regards,
v-sihou-msft
9 years agoMicrosoft Employee
I assuem you assign start date and end date. Then you can create a calculated table with DAX. Please refer to my sample below:
MonthTable =
var FullCalendar = ADDCOLUMNS(CALENDAR("2016/1/1","2017/12/31"),"Month Number",MONTH([Date]),"Year",YEAR([Date]),"Year-Month",LEFT(FORMAT([Date],"yyyyMMdd"),6),"Month Name",FORMAT(MONTH([Date]),"MMM"),"Year-MonthName",YEAR([Date]) & " " & FORMAT(MONTH([Date]),"MMM"))
return
SUMMARIZE(FullCalendar,[Month Number],[Year],[Year-Month],[Year-MonthName])
Regards,
trt18-sistemas
4 years agoAdvocate IV
If you want to build this table using Power Query (M Language), here is my solution: https://stackoverflow.com/questions/70888522/how-to-create-month-table-in-powe-query-m