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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Tejasvi_munge
Frequent Visitor

keep zero after decimal

Hi All,

 

I have a column containing values like 2.3456, 2.304 etc

And I want to limit values upto two decimal points. Also, I cannot use option which modelling ribbon provides beause I am connected live and that option is disabled and cannot use format function as it converts the column into text and will not be able to sort it in descending order.

Also, tried using round function. But, it does not provide expected result like-

If my values are like  2.3446, 2.304 etc then it should return 2.34, 2.30 (not 2.3)

 

Thank you in advance!

1 ACCEPTED SOLUTION

Hi,

 

You can change measure's format:

61.PNG

Or use VALUE function:

measure 2 = VALUE([measure])

Or if you just want to sort, please try to create a rank measure:

rank = RANKX(ALLSELECTED('Table_1'),VALUE([Measure]),,DESC,Dense)

And then sort number by this rank.

 

Best Regards,

Giotto Zhi

View solution in original post

6 REPLIES 6
v-gizhi-msft
Community Support
Community Support

Hi,

 

Please try to use FIXED function to create a measure to show the data format you want, like this:

Measure = FIXED(SELECTEDVALUE(Table_1[Data]),2)

You can specific any number of decimal you want by this function, and it shows:

131.PNG

Hope this helps.

 

Best Regards,

Giotto Zhi

Hi,

 

Thank you for suggestion! 

But Fixed changes the data type into text and will not give correct output while sorting 

For ex- consider values like 9.8, 9.1,10.3

Sorting(desc order) after using Fixed will give output like-9.8, 9.1, 10.3 and not 10.3, 9.8, 9.1   

Hi,

 

You can change measure's format:

61.PNG

Or use VALUE function:

measure 2 = VALUE([measure])

Or if you just want to sort, please try to create a rank measure:

rank = RANKX(ALLSELECTED('Table_1'),VALUE([Measure]),,DESC,Dense)

And then sort number by this rank.

 

Best Regards,

Giotto Zhi

Razwan
Helper I
Helper I

@Tejasvi_munge 
Hi, since you are using a live connection, the only way to build a column is in its data source and not on the report-side. 
However, you may try to build a measure on the report-side, something like:

# MyMeasure = 
      CALCULATE(
          MAX('MyTable'[MyColumn])
      )

Then you can format it using the Modeling ribbon as you wish and append it to your table in the report.


Kind regards,
Razwan

PaulDBrown
Community Champion
Community Champion

@Tejasvi_munge 

I cannot check using a live connection (don't have such a model...) but can you check if you can format your measures in the modeling pane? Select a measure, expand the properties pane, choose "Formatting" and proceed as needed...decimal.JPG

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






As I am live conntected there is only visual pane

Visual.PNG

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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