Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
gmcintire
Regular Visitor

Survey Data - Calculate n-Size Where Some Surveys Are Not Filled In

Hey everybody.  I'm having a bit of a struggle with what is probably a pretty straightforward solution.  We have a model of survey data for our healthcare organization.  So the fact table would look like the following:

 

 EncounterID          SurveyID          QuestionID          WasResponsePositive?

1                             1                      1                           NULL

1                             1                      2                           NULL

1                             1                      3                           NULL

2                             1                      1                           NULL

2                             1                      2                           0

2                             1                      3                           1

 

There's many more columns, but my dilemma really focuses on these.  What we want to calculate is the number of surveys that actually were filled out (n-Size).  In the above sample of data, n-Size would be 1 because only Encounter 2 had any questions at all filled out.  The basic logic is: Per Encounter, Per Survey, are there any non-NULL values in WasResponsePositive?  The dax for this is eluding me and I would really appreciate any insight folks can provide.

 

Thank you.

1 ACCEPTED SOLUTION
gmcintire
Regular Visitor

Actually found the answer to my own question.

 

Create a calculated column:

 

EncounterID_SurveyID:= IF(ISBLANK('Table'[WasResponsePositive?]), NULL, CONCATENATE(EncounterID, SurveyID))

 

Then the measure I need is pretty easy:

 

n-Size:=COUNTDISTINCT('Table'[EncounterID_SurveyID])

View solution in original post

1 REPLY 1
gmcintire
Regular Visitor

Actually found the answer to my own question.

 

Create a calculated column:

 

EncounterID_SurveyID:= IF(ISBLANK('Table'[WasResponsePositive?]), NULL, CONCATENATE(EncounterID, SurveyID))

 

Then the measure I need is pretty easy:

 

n-Size:=COUNTDISTINCT('Table'[EncounterID_SurveyID])

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.