The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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!
Solved! Go to Solution.
@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.
Proud to be a Super User! |
|
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.
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
Thanks
Harish M
Please accept this as a solution if this solves your problem and give kudos as well.
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.
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.
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.
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.
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".
@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.
Proud to be a Super User! |
|