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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
hendrikhendriks
Frequent Visitor

DAX calculate StDev including Blanks

Hi all,

 

I am trying to calculate the standard deviaton of the amount of sales for each product within a certain product category, in order to eventually calculate a Z-score for each customer. However, some customer do not have sales for a specific product (i.e. amount of sales is blank). See example below

 

Filter: Product Category = Y

Customer  Product   Amount of Sales  Average
1A32,4
2A 2,4
3A22,4
4A 2,4
5A72,4
1B 1,4
2B41,4
3B 1,4
4B21,4
5B11,4

 

When I create substitute the amount of sales measure with the following measure:
Amount of sales incl 0 = IF(ISBLANK(_Measures[Amount of Sales]), 0, _Measures[Amount of Sales])

 

The result ignores the product category filter and returns 0's for all customers in the customer dimension. See example below for product A

 

CustomerProductAmount of sales incl 0 
1A3
2A0
3A2
4A0
5A7
6A0
7A0
8A0
9A0
10A0
11A0
12A0

 

Does anyone have any suggestions on how to formulate my StDev or Amount of Sales formula

 

Suggestions are more than welcome!

 

Thank you

 

Hendrik

1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi,  @hendrikhendriks 

How will the field ‘Product Category’ be displayed in the table?

Please try the formula as below:

 

Amount of sales incl 0 = Measures[Amount of Sales]+0

 

If it does‘t work, please share you sample file for further research.

 

Best Regards,
Community Support Team _ Eason

View solution in original post

1 REPLY 1
v-easonf-msft
Community Support
Community Support

Hi,  @hendrikhendriks 

How will the field ‘Product Category’ be displayed in the table?

Please try the formula as below:

 

Amount of sales incl 0 = Measures[Amount of Sales]+0

 

If it does‘t work, please share you sample file for further research.

 

Best Regards,
Community Support Team _ Eason

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.