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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
felipeBI
Regular Visitor

Problem with standar devuation DAX

Good Morning! I have a problem with the fuction STDEV.S (standar devuation)
Data
|2|

|3|

|2|

|9|

|4|

|2|

|5|


In Excel I use the next formula =DESVEST.M(A1:A7), Result: 2.54483604.

In Power BI I have the next table affected with filters with the next formula DESVIACIÓN = CALCULATE(STDEV.S(FactVentas[CANTIDAD]),ALLSELECTED())


Result: 1.07 

felipeBI_1-1630944632329.png

felipeBI_2-1630944930258.png

 

What is the error?

Thank you so much



3 REPLIES 3
v-yetao1-msft
Community Support
Community Support

Hi @felipeBI 

Has your problem been solved ? If it has been solved, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards

Community Support Team _ Ailsa Tao

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

v-yetao1-msft
Community Support
Community Support

Hi @felipeBI 

I think your problem lies in ALLSELECTED() .

ALLSELECTED() : Removes context filters from columns and rows in the current query, while retaining all other context filters or explicit filters. It keeps explicit filters and contexts other than row and column filters. 

So you will include explicit filters and context in your calculations and the result is different from the result that from excel .

I created a sample without any filters and the result is same with the result that from excel .

Column = STDEV.S('Table'[value])

Ailsamsft_0-1631153181541.png

I have attached my pbix file ,you can refer to it .

 

Best Regards

Community Support Team _ Ailsa Tao

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

MFelix
Super User
Super User

Hi @felipeBI ,

 

You issue is related with the context of the ALLSELECTED (check documentation) in this case when you do the all selected you are adding not only the ones that have values but also the ones that have 0, and other values that you are not seeing in filter context.

 

Can you please share a mockup data or sample of your PBIX file. You can use a onedrive, google drive, we transfer or similar link to upload your files.

If the information is sensitive please share it trough private message.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.