Forum Discussion
Anonymous
6 years agoNot applicable
Specifying thousand separator dax function
Hello, I currently have a measure that makes a count. and what I wanted was for the thousands to be separated. but the only option that appears to me is to put the comma. ...
- 6 years ago
Hi,
I create a sample as below:
Then i create a measure to test:
Measure 1 = SUM('Table'[Value])Then try this measure:
Measure 2 = VAR t = SUM ( 'Table'[Value] ) & "" VAR t1 = GENERATESERIES ( 1, LEN ( t ) + ROUNDDOWN ( LEN ( t ) / 3, 0 ), 1 ) VAR t2 = ADDCOLUMNS ( t1, "Char", IF ( [Value] / 4 = ROUND ( [Value] / 4, 0 ), ".", MID ( t, LEN ( t ) - [Value] + 1 + ROUNDDOWN ( [Value] / 4, 0 ), 1 ) ) ) VAR result = CONCATENATEX ( t2, [Char], "", [Value], DESC ) RETURN resultThe result shows:
Hope this helps.
Best Regards,
Giotto Zhi
v-gizhi-msft
6 years agoCommunity Support
Hi,
I create a sample as below:
Then i create a measure to test:
Measure 1 = SUM('Table'[Value])Then try this measure:
Measure 2 =
VAR t =
SUM ( 'Table'[Value] ) & ""
VAR t1 =
GENERATESERIES ( 1, LEN ( t ) + ROUNDDOWN ( LEN ( t ) / 3, 0 ), 1 )
VAR t2 =
ADDCOLUMNS (
t1,
"Char", IF (
[Value] / 4
= ROUND ( [Value] / 4, 0 ),
".",
MID ( t, LEN ( t ) - [Value] + 1 + ROUNDDOWN ( [Value] / 4, 0 ), 1 )
)
)
VAR result =
CONCATENATEX ( t2, [Char], "", [Value], DESC )
RETURN
resultThe result shows:
Hope this helps.
Best Regards,
Giotto Zhi
- noob_dax3 years agoNew Member
Add
IF(MOD(LEN(t),3)=0, MID(result,2,len(result)), result)Or else for 3 paired digits like 424 you will get ,424
Similary 646343 is shown as ,646,343 but should be 646,343