Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
452 views
in Technique[技术] by (71.8m points)

dax - Standard deviation in power pivot with filter

My table looks like this:

CPRNR | Man-years | Salary  | Average pay
-----------------------------------------
XXXXX |      0,5  | 100.000 |     200.000

[Average pay] is a measure based on [Salary]/[Man-years]. What I want is to get standard deviation for [Average pay]. I've tried the following, but it results in an error.

=STDEVX.P(DataCSV , [Average pay])

The error message is:

MdxScript(Model) (6, 34) Calculations error in measure 'DataCSV'[Average pay]: A division by zero has been encountered.

There are 0 values in [Man-years] and for the table I have added a value filter on [Cprnr] ([Man-years] >= 0,825) and I want the standard deviation to only use the values that are left.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

To avoid division by zero error there is the DIVIDE function. You might consider to change the [Average pay] measure to

[Average pay] = DIVIDE([Salary], [Man-years])

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...