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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
Anonymous
Not applicable

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.

Anonymous
Not applicable

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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