简体   繁体   中英

SSAS calculated measure excluding nulls

I have a fact-table like so:

Account# | Age

=============

1|10

2|20

3|NULL

I want to construct a calculated measure that gives me the average age when slicing through my datamodel. When using: '[measure].Age/CountOfAccount#' I dont get the right average. It seems as if the NULL values of Age are seen as zero's and also get used in the calculation. So in the above example ssas in my case does (10+20+0)/3 = 6.67 and this is wrong! In reality the average is: (10+20)/2 = 15

Could someone please help me out on how to construct the right SSAS calculated measure?

Thank you from Holland !

You can change the presentation values NULL as by selecting each measure that you would like to retain the original NULL value. Go to the properties menu (F4) and expand the Source property. From there you want to change the NULLProcessing to Preserve.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM