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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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