Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi!
Im trying to calculate an average measure per SKU (called "Productivity"). However, when I'm not selecting any SKU, the Averagex-measure leaves me with the "NaN" error. I really hope someone can help me, as I struggle to find a proper solution.
Average Productivity per SKU =
Solved! Go to Solution.
Turns out there were missing days/stores for some items in the calculation and thus the error.
IFERROR solved the problem fine.
Turns out there were missing days/stores for some items in the calculation and thus the error.
IFERROR solved the problem fine.
Hi @emilmorkeberg ,
Typically you get NaN when you try to calcualte 0/0
So we recommend that you use the DIVIDE function whenever the denominator is an expression that could return zero or BLANK.
For your case, i think the DAX you used for [# Days w Sales] is fine, just try to use DIVIDE() instead of /
=DIVIDE( DIVIDE([Sales] / [# Days w Sales]), [# Stores w Sales] )
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@emilmorkeberg , if sales is measure , prefer
CALCULATE(COUNTROWS('Date'),FILTER(values('Date'[Date]),[Sales] > 0))
Also use the divide function
example
divide(divide([Sales], [# Days w Sales]),[# Stores w Sales])
User | Count |
---|---|
98 | |
90 | |
82 | |
73 | |
67 |
User | Count |
---|---|
115 | |
102 | |
98 | |
71 | |
67 |