rounding updown decimals

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

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

ROUNDING UP/DOWN DECIMALS

resolvedResolved · Urgent Priority · Version 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:

Data Cleaning and Transformation

Ensure your data is clean and well-structured before importing it into Power BI. Use Power Query Editor to clean and transform your data. This tool allows you to perform various operations like filtering, merging, and reshaping data, ensuring it's in the right format for analysis.

View all Power BI hints and tips


Server loaded in 0.07 secs.