Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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").
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
24 | |
20 | |
15 | |
13 |
User | Count |
---|---|
55 | |
48 | |
43 | |
19 | |
19 |