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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

SQRT error

Hello all, 

 

I am new to DAX and in need of some urgnt assistence. 

 

I am calculating the margin of error for survey results, currently attempting to do this in steps but I cannot seem to get the SQRT function to work. 

 

The formula I am trying to create in DAX is this: 

1.96*sqrt( ( p*(1-p)/n ) * ( (N-n)/(N-1) ) )

 

p= 0.896

I have created measures for N and n

 

My data looks like this and I have split the calculation into steps so I can monitor progress:

 

I cannot get the final step to work

MOE = SQRT(FullDataset[MOE a])

 

Can someone help. 

 

I do know that the I have the result of infinity for 3 records for MOE a where n = 0. But the SQRT of infinity is infinity I didnt think it would matter. 

 

Course CodeNn

MOE P 

( ( p*(1-p)/n )

FPC

( (N-n)/(N-1) ) )

MOE a

(MOE P)*(FPC)

( ( p*(1-p)/n ) * ( (N-n)/(N-1) ) )

MH123141519410.00010.77350.00008
AC35836104780.00020.21670.00004
MH113116714000.00020.76110.00018
MF152515554000.00020.74320.00017
AC151123133880.00020.83260.0002
AC150117403790.00020.78260.00019

 

Any help as urgently as possible would be amazing. 

 

Thanks so much, 

K

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@Anonymous,

 

You just need to add IF Function or IFERROR Function.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-chuncz-msft
Community Support
Community Support

@Anonymous,

 

You just need to add IF Function or IFERROR Function.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thanks so much for responding. Iferror worked like a charm. 

Anonymous
Not applicable

Dear all, 

 

I need some help. 

 

I am trying to calculate the margin of error for a set of surveys. 

 

My formula is as follows:

1.96*sqrt( ( p*(1-p)/n ) * ( (N-n)/(N-1) ) )

 

I cannot get the SQRT function to work in dax so I have split my work up to a series of steps to aid analysis. My data now looks like this. my measures are in bold and I have included the calculation for each one. 

 

I now cannot get the final step of the equation to work. 

 

MOE = SQRT(FullDataset[MOE a]) but this does not work. I get an error. Can I get a square root of a measure? Or could it be due to a few infinity results in MOE a? There is also a NaN result. Woudl this make a difference?

 

It seemed like this was going to be so straightforward but I am very new to this and I just cannot figure this out. 

 

Course CodeNn

MOE P 

( ( p*(1-p)/n )

FPC

( (N-n)/(N-1) ) )

MOE a

( ( p*(1-p)/n ) * ( (N-n)/(N-1) ) )

MH123141519410.00010.77350.00008
AC35836104780.00020.21670.00004
MH113116714000.00020.76110.00018
MF152515554000.00020.74320.00017
AC151123133880.00020.83260.0002
AC150117403790.00020.78260.00019

 

Any help would be appreciated

 

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.