Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Unable to change Rounding

Hello Community,

 

Can someone please let me know why the 'Rounding' is greyed out. I would like to change the rounding to 0 decimal places but I'm unable to, see image.

 

  • Hi Anonymous ,

     

    We should change the data type to Percentage.Type firstly. Then we can decimal places in Modeling.

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMtEzVlWK1cFgxAIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [percentage = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"percentage", Percentage.Type}})
    in
        #"Changed Type"

7 Replies

  • Hello Anonymous 

    It's because the data type for those columns is text so PowerQuery doesn't know you can round it.  If you change it to decimal number you will be able to round it.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for reaching out.

       

      I made the change, and it worked. However, I'm trying to round off so that I don't see any digits after the decimal.

       

      For example, I would like 4% instead of 4.00%. But each time I round I can't get rid of the 0's

       

      • jdbuchanan71's avatar
        jdbuchanan71
        Super User

        I would just make that change in the model layer in PowerBI using formatting rather than in PowerQuery.

         

  • v-frfei-msft's avatar
    v-frfei-msft
    Community Support

    Hi Anonymous ,

     

    We should change the data type to Percentage.Type firstly. Then we can decimal places in Modeling.

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMtEzVlWK1cFgxAIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [percentage = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"percentage", Percentage.Type}})
    in
        #"Changed Type"