Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

rounding updown decimals

Forum home » Delegate support and help forum » Microsoft Power BI training and help » ROUNDING UP/DOWN DECIMALS

ROUNDING UP/DOWN DECIMALS

ResolvedVersion 365

ROUNDING UP/DOWN DECIMALS

Hello,

I was wondering if I could ask for your advice regarding decimal numbers in matrix.

The objective is rather very simple:

I have numbers which have decimal figures (i.e. 0.5, 0.7, 1.25) and so on. For some reason when I change places from "Auto" to "0" , then all of them are rounding up/down accordingly to the value.

What I would like to achieve is to avoid it and to make sure that when I have a figure like "0.5" - it will stay the same - when I set decimal places to "0".

I have been looking for an answer everywhere, but no result so far.


Please let me know, what can be done.

Kind Regards

Piotr Jedrzejczyk

RE: ROUNDING UP/DOWN DECIMALS

Hi Piotr,

Welcome back to the forum!

Thank you for the question.

Just to be clear, you are asking if it's possible to set decimal places to zero on a value but for a visual, such as a matrix, to still show decimal places when displaying that value

The question I need to ask is 'Does the value need to show decimal places in some visuals but not in others?' If this is correct then we cannot just change the decimal places for a value as this change will affect visuals

The solution could be to create a calculated column using Power Query M to round up/down the value column:

1. From your Power BI report go to TRANSFORM DATA to launch the Query Editor

The column (eg. Sales Price) that has the values with decimal places needs to be part of a Power Query formula

2. Go to ADD COLUMN > CUSTOM COLUMN

3. Enter in the 'New Column Name' field 'Sales Price (rounded)

3. In the 'Custom column formula box type:

= Number.Round([Sale Price],0)


4. Set the new calculated column to whole number by going to TRANSFORM > DATA TYPE

5. Click OK and Close & Apply to return to the report view

Now you have the flexibility to choose which visuals can show decimals and which do not

I hope this helps with your question. Please let us know if this is the right solution for you

Kind regards
Martin

RE: ROUNDING UP/DOWN DECIMALS

Hi Martin,


Thank you for your response.

I have followed your instructions, using a given formula in Power Query, and it gives rounded values but not as expected.

It might be the case of using different multiplier for this solution.

Anyway, thank you for giving a try!


Kind Regards,

Piotr Jedrzejczyk

 

Training courses

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Power BI tip:

Scheduled Refresh and Power BI Service

If you're using Power BI Service, set up scheduled refresh for your datasets. This ensures that your reports are always up-to-date with the latest data. Understand the refresh limits imposed by Power BI Service and optimize your data model and queries to stay within those constraints.

View all Power BI hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.09 secs.