Join 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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have created a calendar table, but when i create a month column with a format, it only gives months of January or December. For example i'm getting Feb to June dates returning a month value of January.
The code i'm using is Date = ADDCOLUMNS(CALENDAR("01-Jan-2015","31-12-2017"),"DATEASINTEGER",FORMAT([Date],"DD/MM/YY"),"Year",YEAR([Date]),"MONTH & YEAR",FORMAT([Date],"MMM YYYY")," EOMONTH",FORMAT(EOMONTH([Date],0),"MMMM"),"END OF MONTH",FORMAT(EOMONTH([Date],0),"MMMM/YYYY"),"MONTH",FORMAT(MONTH([Date]),"MMM"))
Solved! Go to Solution.
You don't need to nest any date component formulas inside a FORMAT formula in order to get a single component like month. FORMAT(DateTable[Date], "MMM") should give you what you're looking for.
Proud to be a Super User!
You don't need to nest any date component formulas inside a FORMAT formula in order to get a single component like month. FORMAT(DateTable[Date], "MMM") should give you what you're looking for.
Proud to be a Super User!
Thanks KHorseman, Works a treat.
@KHorseman is lightning fast - so I'll just post a slightly more readable version of @andywil456's formula
EDIT: Now with MONTHSORT column
Date =
ADDCOLUMNS (
CALENDAR ( "01-Jan-2015", "31-12-2017" ),
"DATEASINTEGER", FORMAT ( [Date], "DD/MM/YY" ),
"Year", YEAR ( [Date] ),
"MONTH & YEAR", FORMAT ( [Date], "MMM YYYY" ),
"EOMONTH", FORMAT ( EOMONTH ( [Date], 0 ), "MMMM" ),
"END OF MONTH", FORMAT ( EOMONTH ( [Date], 0 ), "MMMM/YYYY" ),
"MONTH", FORMAT ( [Date], "MMM" ),
"MONTHSORT", INT ( FORMAT ( [Date], "yyyyMM" ) )
)
@Sean very good. While you're at it might as well add a sort order for the Month & Year column
"MonthSort", INT(FORMAT([Date], "yyyyMM"))
Proud to be a Super User!
Well not that fast! ![]()
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 132 | |
| 88 | |
| 82 | |
| 68 | |
| 64 |