Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hi,
I have a Date Column and would like to create INDEX column based on Date values.
For example;
I have Date Column as show in below figure and from Date Column I want to create ID (Index Column) column using Power Query.
NOTE: I have dates info for almost 40 Years. (1994-2034)
Any suggestion/Help Appreciate!
Thanks
Solved! Go to Solution.
Thanks Amit it worked.
Thanks
Hi @damit23183
Try this. It's loading a column of dates from a table called Dates
let
Source = Excel.CurrentWorkbook(){[Name="Dates"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type datetime}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "ID", each Text.From(Date.Year([Date])) & Text.PadStart(Text.From(Date.Month([Date])),2,"0") & Text.PadStart(Text.From(Date.Day([Date])),2,"0"))
in
#"Added Custom"
I'm using d/m/y/ not sure what you have. You may need to swap around the Date.Month and Date.Day parts of the query.
Phil
If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.
Proud to be a Super User!
Thank you Philip for your inputs.
Rellay appreciate it!
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 48 | |
| 46 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 70 | |
| 69 | |
| 32 | |
| 27 | |
| 26 |