Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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 |
| 1 | A | 3 | 2,4 |
| 2 | A | 2,4 | |
| 3 | A | 2 | 2,4 |
| 4 | A | 2,4 | |
| 5 | A | 7 | 2,4 |
| 1 | B | 1,4 | |
| 2 | B | 4 | 1,4 |
| 3 | B | 1,4 | |
| 4 | B | 2 | 1,4 |
| 5 | B | 1 | 1,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
| Customer | Product | Amount of sales incl 0 |
| 1 | A | 3 |
| 2 | A | 0 |
| 3 | A | 2 |
| 4 | A | 0 |
| 5 | A | 7 |
| 6 | A | 0 |
| 7 | A | 0 |
| 8 | A | 0 |
| 9 | A | 0 |
| 10 | A | 0 |
| 11 | A | 0 |
| 12 | A | 0 |
Does anyone have any suggestions on how to formulate my StDev or Amount of Sales formula
Suggestions are more than welcome!
Thank you
Hendrik
Solved! Go to Solution.
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
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
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 4 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 17 | |
| 8 | |
| 8 | |
| 7 |