Title: DAX to separate number with commas
Tags: dax
Question: I need to separate a number with commas
for example number 142531 to show as 14:25:31
Googled for a while and found something like this:
Column =
VAR right =
RIGHT ( [Column1], 3 )
VAR left =
SUBSTITUTE ( [Column1], right, &quot;&quot; )
RETURN
COMBINEVALUES ( &quot;:&quot;, left, right )
This kinda shows me how to do it, I can separate the number in the middle with 1 comma but not sure how to do this with the middle part.

Here is the accepted answer: Time =
VAR left = LEFT ( [RCP_TIME], 2 )
VAR mid = MID ( [RCP_TIME], 3, 2 )
VAR right =  RIGHT ( [RCP_TIME], 2 )
RETURN
COMBINEVALUES(&quot;:&quot;,left, mid, right)
Comment for this answer: You should add some text to the answer
Comment for this answer: Please add an explanation to the code, to improve the quality and to let the OP better catch the answer.


{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2020:00:10/07/20', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<dax>', 'Title': 'DAX to separate number with commas', 'ViewCount': 27, 'id': 64237721, 'user_AboutMe': None, 'user_AccountId': 3975935.0, 'user_DisplayName': 'user245255', 'user_Reputation': 165.0, 'user_Views': 44.0, 'user_id': 12551218.0}}