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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Zael-Leonhart
Helper I
Helper I

Would like to ask how can we easily count a decimal places of a value

Would like to ask how can we easily count a decimal places of a value  to dynamically change the decimal place based on the input value of the client

 

for example,

 

he input 0.0001

 

it is good because it just a default..

 

but if he input 1.00000 or 1.0 or 1.00

 

would like to adjust the output in a gallery whose decimal places are same with the input.. it usually removes the zeros

 

any idea is appreciated thanks so much

1 ACCEPTED SOLUTION
v-kaiyue-msft
Community Support
Community Support

Hi @Zael-Leonhart ,

 

By the design of power bi, it does convert numbers like 1.00 to 1, so consider setting it to text type to keep the original formatting.

You can remove the automatically added change type step in the power query editor and the data will remain in the original text format.

vkaiyuemsft_0-1712627999068.png

 

If you want the numbers to participate in the numeric calculations in dax, you can use the value function, which converts a text string representing a number to a number. More information can be found in the documentation: VALUE function (DAX) - DAX | Microsoft Learn.

 

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

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

View solution in original post

1 REPLY 1
v-kaiyue-msft
Community Support
Community Support

Hi @Zael-Leonhart ,

 

By the design of power bi, it does convert numbers like 1.00 to 1, so consider setting it to text type to keep the original formatting.

You can remove the automatically added change type step in the power query editor and the data will remain in the original text format.

vkaiyuemsft_0-1712627999068.png

 

If you want the numbers to participate in the numeric calculations in dax, you can use the value function, which converts a text string representing a number to a number. More information can be found in the documentation: VALUE function (DAX) - DAX | Microsoft Learn.

 

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

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

Helpful resources

Announcements
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.