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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
nehajadhav166
Resolver I
Resolver I

Cpk calculation difference between power BI and matlab

Hello Experts,

 

In my dashboard I am calculating Cpk values for different charactertsic.

Formula I use is as below:

VAR sigma = STDEV.S(Process[MeasureValue])
VAR estimatedMean = AVERAGE(Process[MeasureValue])
VAR Cplower = (estimatedMean-MIN(Process[LimitLower]))/(3*sigma)
VAR Cpupper = (MAX(Process[LimitUpper])-estimatedMean)/(3*sigma)
RETURN MIN(Cplower,Cpupper)
 
When I calculate Cpk with same set of values in matlab, there is difference in values, eq matlab value is 37.77 and power bi 39.89.
Can you please guide me if I am doing something wrongly in power BI?
 
Thanks in advance.
 
Regards,
Neha
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @nehajadhav166 ,

 

You cannot put the defined variables into the min function.

It only supports column or expressions.

vmengzhumsft_0-1663221246302.png

You can split the two variables, create separate measures for them to be calculated, and then use the min function to compare them.

 

Best regards,

Community Support Team Selina zhu

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

5 REPLIES 5
Anonymous
Not applicable

Hi @nehajadhav166 ,

 

You cannot put the defined variables into the min function.

It only supports column or expressions.

vmengzhumsft_0-1663221246302.png

You can split the two variables, create separate measures for them to be calculated, and then use the min function to compare them.

 

Best regards,

Community Support Team Selina zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

How do I do this if all of my UCL, LCL and Central line values are all measures, and not columns?

@Anonymous ,

 

Process[LimitLower]/Process[LimitUpper] both are columns in table.

Do I have to still change and create measure for this?

 

Thanks,

Neha

Anonymous
Not applicable

Hi @nehajadhav166 ,

If you want to give calculations for them, it is necessary to create MEASURES.
What I mean is that you can split the process of finding the value of these two into two MEASURES

vmengzhumsft_0-1663581507623.png

One measure to calculate Cplower and the other to calculate Cpupper. And then create the third measure to compare the two value.

 

Please let me know if you have any further questions,thanks in advance~

 

Best regards,

Community Support Team Selina zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

 

 

@Anonymous ,

 

My issue is resolved now. There was data discrepency while loading data using power query editor.

I am still using same formula with single mesaure and it works fine for me.

 

Thanks,

Neha

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors