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
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

4 REPLIES 4
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

 

@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
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.