Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
mamatea1218
New Member

split or extract?

Hi,

 

I have a column including datetime that the format is 2025-07-07 at 12:40. Which one solution is better? "split by using delimiter at" or "apply a tramsform to extract the column first 11 chars" ? I'm used to use split to have a time column,but most practice exams show the answer is "extract". Want to know why.

 

Thanks!

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@mamatea1218 If format is constant then extracting first 11 characters is good because Extracting a fixed number of characters is generally faster and less error-prone and It is straightforward if the date part is always exactly 11 characters long.

 

If there is any possibility of variation in the format, splitting by delimiter might be a safer choice.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

8 REPLIES 8
v-pagayam-msft
Community Support
Community Support

Hi @mamatea1218 ,
Could you please confirm if the issue has been resolved on your end? If so, sharing the solution here would be helpful for other community members who may have similar issue.
Thank you.

HarishKM
Memorable Member
Memorable Member

Hey @mamatea1218,
If I have to extract date, I will follow below steps.

Step 1 - open Power query editor

2- choose add column from top ribbon.

3- select your date column

4 - select date drop down then select date only

5 - BINGO  now you have your date column

 

 

HarishKM_1-1752502762763.png

 

 

 

Thanks

Harish M

Please accept this as a solution if this solves your problem and give kudos as well.

 

v-pagayam-msft
Community Support
Community Support

Hi @mamatea1218 ,
I hope the suggestions worked for you. If you found any workaround,please share it the community and accept your answer as solution.It will be helpful for others who are facing similar issue.If it is not resolved, please feel free to reach out!
Thank you.

v-pagayam-msft
Community Support
Community Support

Hi @mamatea1218 ,
Thank you community members for the helpful insights!
Following up to check whether you got a chance to review the suggestion given.If it helps,consider accepting the helpful answer as solution,it will be helpful for other members of the community who have similar problems as yours to solve it faster.If still facing any issue, feel free to reachout. Glad to help.
Thank you.

Regards,
Pallavi.

Omid_Motamedise
Super User
Super User

Hi @mamatea1218 

both methods work, but the preferred one often depends on clarity, flexibility, and intent. 
Splitting is clear and the resul reach in one step (without considering changing type step at following), but it is dependend to "at" and is also case sensitive. 

second option is based on the assumption of fixed length and the fomrat should be consistent and also lelss readable.

If my answer helped solve your issue, please consider marking it as the accepted solution. It helps others in the community find answers faster—and keeps the community growing stronger!
You can also check out my YouTube channel for tutorials, tips, and real-world solutions in Power Query with the following link
https://youtube.com/@omidbi?si=96Bo-ZsSwOx0Z36h
Poojara_D12
Super User
Super User

Hi @mamatea1218 

When working with a datetime column in Power BI that has values like "2025-07-07 at 12:40", both splitting the column using the delimiter "at" and extracting the first 11 characters to isolate the date portion are technically valid. However, using "extract" (e.g., extract the first 10 or 11 characters for the date) is generally considered better practice in formal scenarios or exams for a few key reasons. First, extracting is more robust and efficient—it avoids relying on the exact placement or spacing of a delimiter like "at", which may vary or cause errors if the format slightly changes (e.g., extra spaces). Second, extract operations are cleaner and easier to maintain, especially when you know the date is always fixed in length and at the start of the string. Third, exams and official best practices emphasize predictability and performance, and extract is usually faster and more direct than a split-then-trim operation. That said, splitting by "at" is very intuitive and useful when you want to separate both the date and time into two columns, especially if the delimiter is consistent. In summary, "extract" is preferred in exams and standardized scenarios for its simplicity, stability, and alignment with best practices, even though "split" is perfectly acceptable in hands-on situations.

 

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a "Kudos"

Kind Regards,
Poojara - Proud to be a Super User
Data Analyst | MSBI Developer | Power BI Consultant
Consider Subscribing my YouTube for Beginners/Advance Concepts: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS
mamatea1218
New Member

The format is constant. I think that the answer should be "extract......".

Practice question:"....You need to be able to analyze the complaints by the logged date and use a built-in date hierarchy...."

"Split" will create one more column "Time" ,and it mentions "use a built-in date hierarchy". To minimize data model, "extract" is better than "split".

bhanu_gautam
Super User
Super User

@mamatea1218 If format is constant then extracting first 11 characters is good because Extracting a fixed number of characters is generally faster and less error-prone and It is straightforward if the date part is always exactly 11 characters long.

 

If there is any possibility of variation in the format, splitting by delimiter might be a safer choice.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors