Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
I have data in which year, month number and week number and day number of week is mentioned in separate column. how can i combine all these column to get date.
Thanks
Solved! Go to Solution.
So your data looks like this, except the Date column?
Is this data your Date table or part of your Facts table?
My quick and dirty solution would be to either merge your data with a Date Table that does contain dates, joining on Year, MonthNumber and Weeknummer. Or, alternatively, create a Date Table from scratch.
Here's the M-code for a Date Table that automatically generates dates for a period of 6 years centered on the current year.
let
Bron = {Int64.From(Date.StartOfYear(Date.AddYears(Date.From(DateTime.LocalNow()), -3)))..Int64.From(Date.EndOfYear(Date.AddYears(Date.From(DateTime.LocalNow()),3)))},
#"Geconverteerd naar tabel" = Table.FromList(Bron, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Type gewijzigd" = Table.TransformColumnTypes(#"Geconverteerd naar tabel",{{"Column1", type date}}),
#"Namen van kolommen gewijzigd" = Table.RenameColumns(#"Type gewijzigd",{{"Column1", "Date"}}),
#"Aangepaste kolom toegevoegd" = Table.AddColumn(#"Namen van kolommen gewijzigd", "Year", each Date.Year([Date])),
#"Aangepaste kolom toegevoegd1" = Table.AddColumn(#"Aangepaste kolom toegevoegd", "MonthNumber", each Date.Month([Date])),
#"Aangepaste kolom toegevoegd2" = Table.AddColumn(#"Aangepaste kolom toegevoegd1", "WeekNummer", each Date.DayOfWeek([Date])),
#"Type gewijzigd1" = Table.TransformColumnTypes(#"Aangepaste kolom toegevoegd2",{{"Date", type date}, {"Year", Int64.Type}, {"MonthNumber", Int64.Type}, {"WeekNummer", Int64.Type}})
in
#"Type gewijzigd1"
Hi @noorkhan ,
Try to add a custom column like
= Number.ToText([Year])&"-"&Number.ToText([MonthNumber])&"-"&Number.ToText(([WeekNumber]-1)*7+[day number])You can change the type to date.
Best Regards,
ShundaSteph
So your data looks like this, except the Date column?
Is this data your Date table or part of your Facts table?
My quick and dirty solution would be to either merge your data with a Date Table that does contain dates, joining on Year, MonthNumber and Weeknummer. Or, alternatively, create a Date Table from scratch.
Here's the M-code for a Date Table that automatically generates dates for a period of 6 years centered on the current year.
let
Bron = {Int64.From(Date.StartOfYear(Date.AddYears(Date.From(DateTime.LocalNow()), -3)))..Int64.From(Date.EndOfYear(Date.AddYears(Date.From(DateTime.LocalNow()),3)))},
#"Geconverteerd naar tabel" = Table.FromList(Bron, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Type gewijzigd" = Table.TransformColumnTypes(#"Geconverteerd naar tabel",{{"Column1", type date}}),
#"Namen van kolommen gewijzigd" = Table.RenameColumns(#"Type gewijzigd",{{"Column1", "Date"}}),
#"Aangepaste kolom toegevoegd" = Table.AddColumn(#"Namen van kolommen gewijzigd", "Year", each Date.Year([Date])),
#"Aangepaste kolom toegevoegd1" = Table.AddColumn(#"Aangepaste kolom toegevoegd", "MonthNumber", each Date.Month([Date])),
#"Aangepaste kolom toegevoegd2" = Table.AddColumn(#"Aangepaste kolom toegevoegd1", "WeekNummer", each Date.DayOfWeek([Date])),
#"Type gewijzigd1" = Table.TransformColumnTypes(#"Aangepaste kolom toegevoegd2",{{"Date", type date}, {"Year", Int64.Type}, {"MonthNumber", Int64.Type}, {"WeekNummer", Int64.Type}})
in
#"Type gewijzigd1"
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 23 | |
| 23 | |
| 20 | |
| 18 | |
| 14 |
| User | Count |
|---|---|
| 58 | |
| 51 | |
| 41 | |
| 30 | |
| 24 |