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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register 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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.