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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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
v-mengzhu-msft
Community Support
Community Support

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
v-mengzhu-msft
Community Support
Community Support

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?

@v-mengzhu-msft ,

 

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

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

 

Thanks,

Neha

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

 

 

 

@v-mengzhu-msft ,

 

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.