Forum Discussion
MdxScript(Model) / Calulcation error in (...)
- 5 years ago
Finally, I have tried the following and it works (it seems).
Selling price - conf. level 95% = VAR Alpha = ( 1 - 0.95 ) VAR Size = CALCULATE ( COUNTROWS ( DISTINCT ( 'FACT Order'[packing_line_id] ) ), FILTER ( 'FACT Order', 'FACT Order'[selling price] <> 0 ) ) VAR SDev = [Selling price (Std Dev)] VAR Result = CONFIDENCE.NORM ( Alpha, SDev, Size ) RETURN IF ( SDev > 0, Result, BLANK () ) - 5 years ago
Hi Arnault_,
Congratulations, my idea is also like: IF ( SDev > 0, Result, BLANK () )
Best Regards,
Link
Hi Arnault_,
The confidence interval can not correspond to a single line.
And then you need modify the data type of mrasure [Selling price - conf. level 95%].
Here is the output:
Best Regards,
Link
- Arnault_5 years agoResolver III
Hi v-xulin-mstf ,
Well, what type should I use? I don't get it.
BTW, I figured out that the measure does not work when the standard deviation cannot be calculated.
Indeed [Selling price - conf. level 95%] depends on [Selling price - Std Dev]. I have tried to handle this error but without succeeding. How can I proceed? The expected output would be: if Std Dev is blank or produces an error, then conf. level = blank.
- v-xulin-mstf5 years agoCommunity Support
Hi Arnault_,
If [Selling price - Std Dev] returns the value that does not match the condition, CONFIDENCE.NORM returns the #NUM! error value.
So it is impossible that the measure return blank.
Please refer: https://docs.microsoft.com/en-us/dax/confidence-norm-function-dax
Best Regards,
Link
- Arnault_5 years agoResolver III
Ok, that's the problem. I thaught that we could handle this issue. If one of the argument is not matching, why isn't it possible to get an alternative output which in that case could be "blank" as I suggested.
Something like:
If [Selling price (Std Dev)] ≤ 0, then blank(), otherwise [Selling price - conf. level 95%].