Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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.
Solved! Go to Solution.
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])
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])
User | Count |
---|---|
93 | |
83 | |
77 | |
71 | |
65 |
User | Count |
---|---|
114 | |
101 | |
96 | |
65 | |
60 |