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

An argument of function 'SQRT' has the wrong data type or the result is too large or too small.

Hi Experts

 

I am getting the following error on my DAX Measure cannot see hot to resolve it

Measure

Correlation Coefficent 4

and 

FAME0/Soybean Oil M00 Filled 90 Day Rolling

 

See image of error message

BlueWhite111_0-1679512939111.png

Sample file Data

https://www.dropbox.com/s/xakasafnr11n3q9/SampleData.pbix?dl=0 

 

1 ACCEPTED SOLUTION

To prove, let us see in details on how to get error:

 

a. Create a dummy measure to test 

 

 

Dummy Test Measure = SQRT ( '02 | DAX Measues Correlation Coefficent'[Correlation Coefficent 4] )

 

 

 

b. Create a new page and add a table visual.

sevenhills_0-1679523142474.png

 

c. Add date to the same the table visual and you see the error.

 

sevenhills_1-1679523168500.png

 

sevenhills_2-1679523176115.png

 

d. now, remove the dummy measure and you can see the data as negative values.

sevenhills_3-1679523200379.png

 

Hope this helps!

View solution in original post

5 REPLIES 5
Greg_Deckler
Super User
Super User

@Anonymous SQRT of a negative number is simply i multiplied by the SQRT of the absolute value. Where i is the square root of -1 (imaginary). I have a version of SQRT that can handle complex numbers: IMSQRT - Microsoft Power BI Community


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
sevenhills
Super User
Super User

Reason: you are doing SQRT on negative values, in your case.

To prove, let us see in details on how to get error:

 

a. Create a dummy measure to test 

 

 

Dummy Test Measure = SQRT ( '02 | DAX Measues Correlation Coefficent'[Correlation Coefficent 4] )

 

 

 

b. Create a new page and add a table visual.

sevenhills_0-1679523142474.png

 

c. Add date to the same the table visual and you see the error.

 

sevenhills_1-1679523168500.png

 

sevenhills_2-1679523176115.png

 

d. now, remove the dummy measure and you can see the data as negative values.

sevenhills_3-1679523200379.png

 

Hope this helps!

Anonymous
Not applicable

Hi sir that helps but how do I amend correlation coefficient 4. To make my messure work. 

SQRT - by default, we cannot find the square root of a negative number. You can google for details "SQRT negative number"

 

Now you need to look your DAX business logic and make sure the values used in SQRT are positive values. 

 

Technically, you can use ABS to get always positive value, but not sure how  it effects and what the business logic needs are ... 

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.