The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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")
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
99 | |
93 | |
81 | |
63 | |
56 |
User | Count |
---|---|
247 | |
122 | |
110 | |
77 | |
72 |