Forum Discussion
Chandan3
4 years agoNew Member
Formatting numbers in a visual based on its value
Hi everyone, I'm using Treemap visual with two levels of data. For a clean report, I want to round the numbers. In Indian number system, 100,000 (hundred thousand) in international number sys...
- 4 years ago
When I answered this I found what I was looking for. I just had to remove the text and add the measure instead.
Amount = VAR YourValue = SUM('Tablename'[Value])RETURNSWITCH(TRUE(),YourValue >=100000, ROUND(YourValue,-3),ROUND(YourValue,-2))
Anonymous
4 years agoNot applicable
Hi Chandan3 ,
You can do it with DAX.
Create the following measures:
Measure =
VAR YourValue = SUM('Table'[Num])
RETURN
SWITCH(TRUE(),
YourValue >=10000000, FORMAT(YourValue,"##\,##\,##\,##0"),
YourValue >=100000, FORMAT(YourValue,"##\,##\,##0"),
FORMAT(YourValue,"##,##0")
)Measure 2 =
VAR YourValue = SUM('Table'[Num2])
RETURN
SWITCH(TRUE(),
YourValue >=100000, ROUNDDOWN(DIVIDE(YourValue,100000),2)&"L",
ROUNDDOWN(DIVIDE(YourValue,1000),2)&"K")
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Chandan34 years agoNew Member
I want the numbers within the visual to follow this formatting. Is there some way to use measures within a visual? I don't think is possible because measure with text added is text and not a number.
- Chandan34 years agoNew Member
When I answered this I found what I was looking for. I just had to remove the text and add the measure instead.
Amount = VAR YourValue = SUM('Tablename'[Value])RETURNSWITCH(TRUE(),YourValue >=100000, ROUND(YourValue,-3),ROUND(YourValue,-2))