Forum Discussion
Pre & Post Analysis
- 4 years ago
Hi Anonymous ,
6 months before and after date of enrollment.
You need a table contains a column which used to be the Axis like line chart you provided. I create a table like this:
Then create a measure via this code:
Measure = VAR _d = CALCULATE ( SELECTEDVALUE ( Patients[Date of Review] ), ALLNOBLANKROW ( Patients ) ) VAR _diff = SELECTEDVALUE ( 'Axis'[value] ) VAR _datestart = DATE ( YEAR ( _d ), MONTH ( _d ) + _diff, 1 ) VAR _dateend = DATE ( YEAR ( _d ), MONTH ( _d ) + _diff + 1, 1 ) - 1 RETURN IF ( SELECTEDVALUE ( Patients[Full Name] ) = BLANK (), COUNTROWS ( FILTER ( ALL ( 'Calls' ), [Incident Date Time] >= _datestart && [Incident Date Time] <= _dateend ) ), COUNTROWS ( FILTER ( 'Calls', [Incident Date Time] >= _datestart && [Incident Date Time] <= _dateend ) ) )Before you use this measure correctly, a relationship between calls and patients on name need to be created.
And result:
Best Regards!
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- 4 years ago
Hi Anonymous ,
Response of your questions.
2. The Axis table ( dimmonth ) was created by enter data, so just remove -6 month and others you do not want, but keep the [value] is right due to the [value] is identified as parameter for the DAX formula.
1. Sort the column(dimmonth) by [value] column.
3 If there are different review date for each patient, please use this code:
Measure = VAR _diff = SELECTEDVALUE ( 'Axis'[value] ) VAR _s = SUMMARIZE ( 'Patients', Patients[Full Name], Patients[Date of Review], "COUNT", COUNTROWS ( FILTER ( 'Calls', [Incident Date Time] >= DATE ( YEAR ( EARLIER ( Patients[Date of Review] ) ), MONTH ( EARLIER ( Patients[Date of Review] ) ) + _diff, 1 ) && [Incident Date Time] <= ( DATE ( YEAR ( EARLIER ( Patients[Date of Review] ) ), MONTH ( EARLIER ( Patients[Date of Review] ) ) + _diff + 1, 1 ) - 1 ) ) ) ) RETURN SUMX ( _s, [COUNT] )Pbix in the end you can refer.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
lbendlin , Many thanks for your readiness to help. I am attaching the tables and expected results to this post. Feel free to ask questions about the data you might have:
| Incident Number | Date | Age | Disposition | Description | Location | ZIP | Patient Name |
| G210056010 | 1/1/2018 | 14 | Sick | Cant walk | Accra | 23345 | Baba,Kosi |
| G210056011 | 1/2/2018 | 15 | Pain | sleep walk | Nairobi | 23346 | Melic,Konan |
| G210056012 | 1/3/2018 | 16 | neck issue | red stool | Capetown | 23347 | Babe,Roon |
| G210056013 | 1/4/2018 | 17 | scratches | diarhhea | Lusaka | 23348 | Musa,Traore |
| G210056014 | 1/5/2018 | 18 | itches | cough | Brazzaville | 23349 | Tonga,Managa |
| G210056015 | 1/6/2018 | 19 | COPD | Cant walk | Accra | 23350 | Haya,Wakubo |
| Full Name | DOB | Date of Review |
| Baba,Kosi | 8/16/1948 | 9/15/2021 |
| Melic,Konan | 5/31/1985 | 9/15/2021 |
| Tonga,Managa | 2/19/1981 | 9/15/2021 |
You say that date of enrollment is September 15, 2021 for all. Your sample incident data only has calls before that date, and none of the calls are within six months.
Without sample data that matches the request it is hard to come up with a meaningful proposal.
- Anonymous4 years agoNot applicable
lbendlin The incident data is such a huge one it will be tedious to mask the names and may not attach them as a file. What I was hoping is that we could use the sample to come up with a solution. What do you recommend??
- lbendlin4 years agoSuper User
If you like to get meaningful help you will want to provide meaningful sample data that fully covers your issue.
- Anonymous4 years agoNot applicable
I have obtained a year worth of data. We can try 5 months before and maybe 3 months after. Let me know if the link works .
Thanks for your help