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
will2018
Regular Visitor

Decimals

I want to remove deciamls from 2 places in POwerBI Desktop

 

1. My Column Headers are based on Period Numbers whcih come form a database numeric field

    e.g. 2016  2016  2017  2018, but on th column headers across the top its showing as

         2016.00   2017.00   2018.00

         How do I remove the decimals from he Header line

 

2.   In some columns I want to show the Cell ata withou a decimal poin e.g. 100.23   as 100

 

 

1 ACCEPTED SOLUTION

Hi POnk

 

Ok, with a bit of trial and error, figured it out.

To change the formtting, you have to have the clumn highlighted in the Tables section

When I did this, I culd change the decimals

Also sorted ny second query

 

Thanks again for your replies

 

 

View solution in original post

6 REPLIES 6
p0nk
Frequent Visitor

If you go into the query editor, select the table and right-click 'Rename' and manually change the name of each column. It may take a while based on the amount fo columns you have but it is the easiest (and only) way I know.

 

In relation to your second question, in the query editor you can select the column and go to Transform, Rounding. From here you can set the amount of decimal places for a colum, but only works if the column type is numerical.

HI ......Many thanks for your reply

 

Point 1.

I renamed the column , but I can't see  anywhere that I can specify zero decimals

 

Point 2.

I have done as you suggested , by going to the raw data and 'Rounding ' it.

However, dont think this will give accurate results

I could have say 1,000,000 rows and if I round at each row level, when it sums , its not going to be very accurate

Say I have a million rows, and 5 product groups, summing all the rounded values not going to be very accurate

What I was hoping for, was for PowerBI to sum say the 1,000,000 rows into 4 groups say, and then Round the Total, but only round at the total level....I think this would be more accurate rather than first rounding each individual row

e.g.

Val     Ronded

1.5     2

1.5     2

1.5     2

1.5     2

         ---

          8

 

1.5 * 4 = 6.0  rounds to 6 if doing at total level rather than individual row level (Which would give 😎

(An exttreme example but for illustration purposes only)

 

 

 

 

p0nk
Frequent Visitor

1. When you rename the headings of the columns, you should jsut be able to replace 2017.00 with 2017. I am not sure why it is adding decimal places onto the column header.

 

2. Apologies, I misunderstood you. If you go into the the data view, select the column and go to the modelling tab, you should be able to set the decimal places under the formatting section. However if you want accurate results, I would just leave the data as it is as there is no real need to round unless you are going into 5 or more decimal places. 

Hi POnk

 

Ok, with a bit of trial and error, figured it out.

To change the formtting, you have to have the clumn highlighted in the Tables section

When I did this, I culd change the decimals

Also sorted ny second query

 

Thanks again for your replies

 

 

p0nk
Frequent Visitor

That's alright, I forgot to say that in my answers. Sorry about that but glad you have sorted your issues.

hI pONK

Re 1st query, to clarify, the actual Data is taken ffrom a table (Not the Column Names)

So there is a column in the datatbae called Year (Date would be 2016 2017 2018 etc) and is is this Data that appears on each column

So If I have 3 years data , it pivots to 3 columns say 2016.00  2017.00    2018.00 and I want to remove the decimals from the heading column

 

Re 2nd query, tried that, can see  Modelling Tab, and Formatting Option where decimals, % etc can be changed

However, this block is greyed out when I go into it and I cannot change anything

Does it need to be enabled somewhere

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.