Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hi there
Happy Friday everyone
Can someone help me please? I'm trying to calculate a sample size value from a dataset. For example below
My overall total count is 24074
I want a 95% confidence
margin of error of 3%
I know my end figure should be 1022. (I used survey monkey site to get this figure) But for the life of me I dont know how to replicate this figure in DAX so I don't need to hard code it in and change it every time my main fogure of 24074 increases or decreases.
Done anyone know how to create this i DAX please...... I'm stumped
Many thanks
Karen
Solved! Go to Solution.
Sample Size Required =
VAR N = COUNTROWS( 'YourTable' )
VAR Z = 1.96
VAR p = 0.5
VAR E = 0.03
VAR n0 = ( Z * Z * p * (1 - p ) ) / ( E * E )
VAR nCorr = ( N * n0 ) / ( N + n0 - 1 )
RETURN
ROUNDUP( nCorr, 0 )
Here's the DAX for the sample size calculation:
Replace 24074 with COUNTROWS(YourTable) to make it dynamic. This will give you ~1022.
Sample Size Required =
VAR N = COUNTROWS( 'YourTable' )
VAR Z = 1.96
VAR p = 0.5
VAR E = 0.03
VAR n0 = ( Z * Z * p * (1 - p ) ) / ( E * E )
VAR nCorr = ( N * n0 ) / ( N + n0 - 1 )
RETURN
ROUNDUP( nCorr, 0 )
You are a genius, thank you so much. This is ace
Have a fabulous weekend, you've made me very happy
Kind regards
Karen
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 43 | |
| 38 | |
| 35 | |
| 21 | |
| 15 |
| User | Count |
|---|---|
| 63 | |
| 58 | |
| 28 | |
| 27 | |
| 25 |