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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
michaelsh
Kudo Kingpin
Kudo Kingpin

Rounding problem. Zero is actually 0.00000000004

If I format my measure with 12 decimal places, I see numbers such:

0.000000000004 (should be 0)

-19.999999999998 (which is -20)

I doubled checked, my measure is decimal with 2 decimal places.

I also dbl-check my column, which the measure sums - it is also a decimal with 2 decimal places.

I also added Round step in Power Query to 2 decimal places.

Still facing this issue.

My measures often check for zeros, so IF(Measure=0,true(),false()) returns FALSE while it is 0.

I solved it for now by doing >-0.01&&<0.01 but why is it like this?

3 REPLIES 3
AllisonKennedy
Super User
Super User

@michaelsh Rounding in Power Query will work, but formatting the measure to 2 decimal places does nothing to the actual value. It just displays it to 2 decimals but does not truncate/round the value. 

 

What is the formula for your measure? If you're doing any sort of average or complex calculation that results in decimals, you may get non-zero values.

 

You can use the DAX ROUND https://docs.microsoft.com/en-us/dax/round-function-dax function (or ROUNDUP or ROUNDDOWN depending on what you want). 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Rounding in Power Query to 2 decimal places didn't work either.

My measure is a simple SUM(Column)

I would prefer not to use ROUND() in my measures - it looks to me quite nonsence to remember to do it each time. There has to be an explanation to this, so I can fix the root of the problem.

Please help

@michaelsh  Sorry I wasn't clear. Rounding in Power Query works only for the column. Once you create a measure, it will need rounded again. You cannot access measures in Power Query, therefore these cannot be rounded. Power BI Order of Operations 

 

It does seem strange that this would happen on a SUM measure - is there absolutely no other calculation happening in the report anywhere? I would be keen to see what's happening - are you able to replicate the problem with a dataset and report you can share via onedrive please?


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.