Forum Discussion
pierre415
Helper I
9 years agoCalendar 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,
Anonymous
8 years agoNot applicable
If you look more closely, you will see that your result is unfortunately wrong for Year-MonthName:
indeed, year = 2016
month number = 1
year-month = 201601
year-monthname = 2016 Dec
same for all other month, you have Jan for all other month instead of the real expexted value.
unfortunately, I still do not have found a fix for this strange behaviour.
vhw04
5 years agoNew Member
I found that if you keep everything that v-sihou-msft had but change the Year - Month Name part of the formula to this, it works correctly:
"Year-MonthName",YEAR([Date]) & " " & FORMAT([Date],"MMM"))