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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
chavanr
Resolver I
Resolver I

Split time value column in DAX

Hi there,

 

I have created a new calculated column with "concatenate" function  & need to split the same new column as per the "-" seperator.

I need the time value which is on the right side as my Output, for which I have used RIGHT function but it is not quite useful as the space length is giving a extra letter from the concatenate function for some values if I adjust the length then I miss the one letter (please see below)

chavanr_0-1611697284460.png 

chavanr_1-1611697773296.png

 

I was wondering if we anyone has solution to fix this issue.

 

Many thanks !!

6 REPLIES 6
Anonymous
Not applicable

Hello @chavanr 
You can try this.

New Time = RIGHT( Recordings[Time], 11)
After calculating change to time.
Capture.PNG
AnkitKukreja
Super User
Super User

Hi @chavanr 

I hope I got your reuirement right, please try below dax

 

CommunitySolution.JPG

Time in New2 =
     RIGHT( 'Time Split'[TIme in new] , 10)
If still it doesn't work create another column and use Trim function to remove extra spaces.
 
For Power BI trainings or support dm or reach out to me on LinkedIn.
If my response has successfully addressed your question or concern, I kindly request that you mark this post as resolved. Additionally, if you found my assistance helpful, a thumbs-up would be greatly appreciated.

Thanks,
Ankit Kukreja
www.linkedin.com/in/ankit-kukreja1904

Hi @AnkitKukreja 

I am already using the RIGHT function & also tried to use the trim function(to remove spaces) as well but not useful as it is converting the data type 'time' to 'text' & removes the seconds value for the time stamp

chavanr_0-1612323208208.png

 

amitchandak
Super User
Super User

@chavanr , Try a new column like this in DAX

right([time in new] , len([time in new]) - search("-",[time in new],,0)+1)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak 

 

Facing a issue with format now, after concatenate, the "Time In New" column is converted to text.

 

Error message"Cannot convert value '9:32:30 AM-' of type text to type number.

 

I did use the FORMAT for the "Time In New" column but is still gives in text format

Is there a workaround for this one?

 

Many thanks!!

Thanks @amitchandak  will try !!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.