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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
NISHA_S
Resolver I
Resolver I

Adding commas to a text numeric value

Capture.PNG

I have text type column1 which has  some numberic values.I want to put commas to the values, just like the screenshot shown above..

I tried like below... but not done correctly...Plse help

test =
VAR right =RIGHT ( [column1], 3 )
VAR left =SUBSTITUTE ( [column1], right, "" )
RETURN
COMBINEVALUES ( ",", left, right)

 
1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @NISHA_S 

you can use this measure:

 

Measure = 
var _text=MIN('Table'[Column1])
var _len=LEN(MIN('Table'[Column1]))
return 
SWITCH(TRUE(),
_len<=3,_text,
_len>3&&_len<=6,LEFT(_text,_len-3)&","&RIGHT(_text,3),
_len>6&&_len<=9,LEFT(_text,_len-6)&","&MID(_text,_len-5,3)&","&RIGHT(_text,3))

 

result

vxiaotang_0-1626946891445.png

 

 

 

Best Regards,

Community Support Team _ Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xiaotang
Community Support
Community Support

Hi @NISHA_S 

you can use this measure:

 

Measure = 
var _text=MIN('Table'[Column1])
var _len=LEN(MIN('Table'[Column1]))
return 
SWITCH(TRUE(),
_len<=3,_text,
_len>3&&_len<=6,LEFT(_text,_len-3)&","&RIGHT(_text,3),
_len>6&&_len<=9,LEFT(_text,_len-6)&","&MID(_text,_len-5,3)&","&RIGHT(_text,3))

 

result

vxiaotang_0-1626946891445.png

 

 

 

Best Regards,

Community Support Team _ Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi ... Outlet code is the TEXT ... have created matrix table and put outlet code in the values .... how to separate the figures in the table with comma .... check the highlighted table values ... need comma after 3 digit

nikhilmayur1988_0-1642489906973.png

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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