Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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])
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
104 | |
78 | |
68 | |
61 |
User | Count |
---|---|
144 | |
106 | |
106 | |
82 | |
70 |