Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Relativly new to Power Query, needing some help on how I would go about extracting the date from a column that has multiple dates / text. Column contains data such as below, I would like to have the custom column generate the (orange text) latest due date.
All Due Dates | Original Due Date (new column) |
Original Due Date: Revised Due Date: | 12/31/2022 |
Original Due Date: 12/31/2023 | 12/31/2023 |
12/15/2023 | 12/15/2023 |
a. 12/31/2022 b. 01/31/2023 c. 10/31/2022 d. 09/31/2022 | 01/31/2023 |
null |
Solved! Go to Solution.
= Table.AddColumn(Source, "Custom", each try Date.From([All Due Dates]) otherwise Date.From(Text.Select([All Due Dates], {"/", "0".."9"})))
Hi @aachavez13 ,
I see you've already accepted a solution to this thread but, for future readers, I would just update my original column calculation to this:
Text.Select(Text.From([All Due Dates]), {"/", "0".."9"})
...or to explicitly output to date format to handle regional formats and two-digit years:
Date.From(
Text.Select(
Text.From([All Due Dates]),
{"/", "0".."9"}
)
)
Pete
Proud to be a Datanaut!
Hi @aachavez13 ,
In Power Query add a new custom column like this:
Text.Select([All Due Dates], {"/", "0".."9"})
You'll then just need to change your new column to to a date data type.
Pete
Proud to be a Datanaut!
Thank you BA_Pete,
this did help however I am now running into an Error on the lines that do not contain text and only contain a date. If possible I would also like this data to be pulled into the new column.
Due Dates | Original Due Date (new column) |
Original Due Date: Revised Due Date: | 12/31/2022 |
Original Due Date: 12/31/2023 | 12/31/2023 |
12/15/2023 | 12/15/2023 - Error |
a. 12/31/2022 b. 01/31/2023 c. 10/31/2022 d. 09/31/2022 | 01/31/2023 |
Hi @aachavez13 ,
I see you've already accepted a solution to this thread but, for future readers, I would just update my original column calculation to this:
Text.Select(Text.From([All Due Dates]), {"/", "0".."9"})
...or to explicitly output to date format to handle regional formats and two-digit years:
Date.From(
Text.Select(
Text.From([All Due Dates]),
{"/", "0".."9"}
)
)
Pete
Proud to be a Datanaut!
= Table.AddColumn(Source, "Custom", each try Date.From([All Due Dates]) otherwise Date.From(Text.Select([All Due Dates], {"/", "0".."9"})))
Thank you so much, that did the trick!!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
13 | |
13 | |
11 | |
8 | |
8 |
User | Count |
---|---|
17 | |
10 | |
7 | |
7 | |
7 |