Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi All,
I'm having some trouble with a bit of DAX code.
What I would like to do is generate a calendar whether the Months are the most detailed level.
Currently my code looks like this:
Solved! Go to Solution.
try like that
Just change "Month Name", FORMAT([Date],"mmmm").
Hi @Anonymous ,
Solution already provided above.
Regards,
Harsh Nathani
Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!
Hi @Anonymous ,
Solution already provided above.
Regards,
Harsh Nathani
Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!
Thank you for this. This did the trick.
Any Idea why the Month() for the monthname caused an issue?
@Anonymous , I corrected the format please check
MonthTable =
var varCalendar =
ADDCOLUMNS(
CALENDAR("2000/1/1","2030/12/31"),
"Year", year([Date]),
"Year-Month", format([Date],"YYYY-MM"),
"Month Number", Month([Date]),
"Month Name", format([Date],"mmmm"))
return
//DISTINCT(CALENDAR
SUMMARIZE(varCalendar, [Year],[Year-Month],[Month Number], [Month Name])
Try this:
Table =
VAR MinDate =
YEAR ( MIN ( Sales[Order Date] ) ) //Replace Sales with any table with dates
VAR MaxDate =
YEAR ( MAX ( Sales[Order Date] ) ) //Replace Sales with any table with dates
VAR CalendarStartDate =
DATE ( MinDate, 1, 1 )
VAR CalendarEndDate =
DATE ( MaxDate, 12, 31 )
VAR DateList =
CALENDAR ( CalendarStartDate, CalendarEndDate )
VAR Result =
GENERATE (
DateList,
VAR StartDate = [Date]
RETURN
ROW (
"MonthNumber", MONTH ( StartDate ),
"Month Name", FORMAT ( StartDate, "MMMM" ),
"Year", YEAR ( StartDate ),
"Year Month", FORMAT ( StartDate, "YYYY MM" )
)
)
RETURN
SUMMARIZE ( Result, [Year], [Year Month], [Month Name], [MonthNumber] )
try like that
Just change "Month Name", FORMAT([Date],"mmmm").
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
24 | |
9 | |
7 | |
6 | |
6 |
User | Count |
---|---|
29 | |
11 | |
11 | |
10 | |
6 |