Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
I currently have the below calendar.
Dates =
VAR MinYear = YEAR ( MIN ('Fact'[Employment Start Date] ) )
VAR MaxYear = YEAR ( MAX ('Fact'[Employment End Date] ) )
RETURN
ADDCOLUMNS (
FILTER (
CALENDARAUTO( ),
AND ( YEAR ( [Date] ) >= MinYear, YEAR ( [Date] ) <= MaxYear )
),
"Year", FORMAT([Date], "yyyy"),
"Date2",FORMAT( [Date], "dd/mm/yyyy" ),
--"Calendat Year", "CY " & YEAR ( [Date] ),
"Month Name", FORMAT ( [Date], "mmm" ),
"Month Number", MONTH ( [Date] ),
"Weekday", FORMAT ( [Date], "dddd" ),
"Weekday number", WEEKDAY( [Date] ),
"Year Month", FORMAT ( [Date], "mmm yy"),
"Month-Year", FORMAT ( [Date], "mmm-yyyy"),
"Month-Year 2", FORMAT ( [Date], "mmm,yy"),
"Quarter", "Q" & TRUNC ( ( MONTH ( [Date] ) - 1 ) / 3 ) + 1
)
The column "Month Number", MONTH ( [Date] ), is show the months between January to September as a single number i.e 1 to 9
I require a zero in front so it shows as 01, 02, 03 etc..
I tried to add a calculated column but it shows up as an Error on the result set
Thanks
Solved! Go to Solution.
@AvPowerBI , try like
format(MONTH ( [Date] ), "00")
Hi, @AvPowerBI
You can check the following methods.
Month = FORMAT(MONTH(Dates[Date]),"00")
Start of Month = "01-"&[Month]&"-"&[Year]
More information about time and date formats can be found in the following links.
https://docs.microsoft.com/dax/format-function-dax
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@AvPowerBI , try like
format(MONTH ( [Date] ), "00")
User | Count |
---|---|
96 | |
87 | |
78 | |
72 | |
68 |
User | Count |
---|---|
113 | |
105 | |
84 | |
65 | |
64 |