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
Anonymous
Not applicable

Significant figures in a column

Hi! I need to format a column so that the significant figures are consistent throughout (for example, 204 and 12 would be 204 and 12.0). I've tried every format and data type I can find, but always end up with a certain number of decimal places, not digits.

Any advice would be greatly appreciated! Thanks-

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I don't know of any function that could do it on its own, but would it be a possibility for you to set it up yourself using something like a switch?

 

If you know you have numbers between 0 and 999, something like this:

Measure = SWITCH(TRUE(),
    [number] < 100, FORMAT([number], "0.0"),
    [number] < 10, FORMAT([number], "0.00"),
FORMAT([number], "0"))

with [number] as whatever measure/column you need to format. If you don't know what range of number you'll have... I'm not sure if there's a neat way to go about it without reinventing the wheel.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

I don't know of any function that could do it on its own, but would it be a possibility for you to set it up yourself using something like a switch?

 

If you know you have numbers between 0 and 999, something like this:

Measure = SWITCH(TRUE(),
    [number] < 100, FORMAT([number], "0.0"),
    [number] < 10, FORMAT([number], "0.00"),
FORMAT([number], "0"))

with [number] as whatever measure/column you need to format. If you don't know what range of number you'll have... I'm not sure if there's a neat way to go about it without reinventing the wheel.

Anonymous
Not applicable

That did it! Thank you so much! 

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.