Forum Discussion
91asma2
5 years agoHelper I
Summarize Function
91asma2
5 years agoHelper I
Thank you so much.
Anonymous
5 years agoNot applicable
Of course you're getting BLANKS. That's obvious when you look at your measure and think for a sec. You're trying to filter AssesmentID's using the [Disorders Ct] measure. It's obvious that for any one particular assessment the measure will return either 0 or 1. So the filter removes all assessments.
You should not have changed the measure OwenAuger gave you because if you want to count the USERS where [Disorders Ct] > 1, then it makes no sense whatsoever to filter assessments by the mentioned measure.
By the way, one more way to write the measure is this:
Disorders Ct =
var Score_ =
SELECTCOLUMNS(
{1},
"@Score", [Value]
)
var Category_ = {
"ADDICTION",
"ADHD",
"APNEA",
" DEPRESSION",
"GEN_ANX",
"PTSD",
"SOC_ANX"
}
var Filter_ =
CROSSJOIN(
Score_,
Category_
)
var Result =
CALCULATE(
DISTINCTCOUNT( Assessment[assessment_id] ),
// If you want to obey any filters that are
// already present on either [Assses Score]
// or [Assess Category] you have to wrap
// the TREATAS in KEEPFILTERS. If in doubt,
// just use this measure first and then the
// version with:
//
//KEEPFILTERS(
// TREATAS(
// Filter_,
// Assessment[Assess Score],
// Assessment[Assess Category]
// )
//)
//
// KEEPFILTERS enables you to join filters
// in the measure and coming from outside
// in an AND operation instead of overwriting
// which is the usual semantics of filters in
// CALCULATE.
TREATAS(
Filter_,
Assessment[Assess Score],
Assessment[Assess Category]
)
)
return
Result