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
Anonymous
Not applicable

DAX - Why Does 3.3/1.1 = 2.9999999999999997?

Hi

 

I have a simple calculation which divides one number by a second number and then puts the result into buckets. However i have found results in the wrong bucket because some simple divisions are coming up with some strange answers.

 

 
I find that when using decimals some calculations don't come out correctly and therefore end up inthe wrong bucket. If you add this calculated column to any workbook
test_calc = DIVIDE(3.3,1.1) = 2.9999999999999997
you get the answer TRUE
 
because the bucket this calcuation should be in is equal to or greater than 3 it is falling in the wrong place.
 
 
Does anyone know why this happens, and any way to make this calculate correctly? Not looking for a work around (i.e. rounding), looking for understanding and/or solution.
 
3 REPLIES 3
amitchandak
Super User
Super User

I tried the same, but Power BI does not allow me to show more than 15 decimal places. So I am getting 3. In your case, it is 16.

I think this is true with all decimal place calculation. Ultimately these calculations happen in binary were decimal place has an accuracy level. 

Anonymous
Not applicable

It does display as 3 for me too, but if I try to use a logic operator it doesn't come out right. If you try a calculated column like 'test_calc = 3.3/1.1 = 3'. It will be False 

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.