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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
mthomeer
Frequent Visitor

Summarize answers to a recurring questionnaire by time intervals

Dear Community

 

Problem

We send a questionnaire about quality of life to our patients, who are treated for cancer. It is a questionnaire (https://qol.eortc.org/questionnaire/eortc-qlq-c30/) that is recurring at different time-intervals: baseline, month 3, month 6, month 12, month 24, month 36, month 48, and month 60.

An additional challenge is that the date of the answer to the questionnaire is not always the date when the question was sent, but is usually answered within one month.

 

 

Input table

PatientIDDate Questionnaire answeredAnswer Q1
patient Add/mm/yyyy5
Patient Bdd/mm/yyyy4
patient Add/mm/yyyy8
patient Bdd/mm/yyyy2
....  

 

Output

The output is to summarize the answers (mean) by each time-interval:

y-axis: mean "Answer Q1"

x-axis: baseline, month 3, month 6, month 12, month 24, month 36, month 48, and month 60.

 

I am just a simple doctor. I can't get this put together. But if the data can be displayed in this way, the care team can focus well on areas for improvement in the care of the patient with cancer.

 

I hope you can help me

 

Michiel

 

@mikekinsman @Nathaniel_C @AIB

1 ACCEPTED SOLUTION

Hi @mthomeer ,

 

Add the following measure:

AVerage of evaluation = AVERAGEX(VALUES('Table'[PatientID]), [Evaluation])

 

This does the averages of the values per patient of the previous measure:

MFelix_0-1611687871398.png

PBIX file attach.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

7 REPLIES 7
MFelix
Super User
Super User

Hi @mthomeer ,

 

To what I can understand from your information you want to have your chart divided by the first response (baseline), second response (3 months), and so on is this correct?

 

You can do the following:

  • Add a table with the periods:

MFelix_0-1611583608783.png

Be aware that the ID is very importat for this solution.

  • Add two measures:
RankDates =
RANKX (
    ALLSELECTED ( 'Table' ),
    CALCULATE ( MAX ( 'Table'[Date Questionnaire answered] ) ),
    ,
    ASC
)


Evaluation =
VAR tem_table =
    SUMMARIZE (
        'Table',
        'Table'[PatientID],
        'Table'[Date Questionnaire answered],
        'Table'[Answer Q1],
        "rank", [RankDates]
    )
RETURN
    AVERAGEX (
        FILTER ( tem_table, [rank] = SELECTEDVALUE ( Months_Respose[ID] ) ),
        'Table'[Answer Q1]
    )

 

Basically on the measure above what I'm doing is ranking the answers, so if the person answers all the questionaires you send them (no matter what the date is) you will get the order so 1 , 2, 3, ... this will be the value that I will be comparing wiht the period and then use that to return the question result:

 

MFelix_1-1611583782965.png

Be aware that if the patient does not answer one of the surveys the dates from that survey on will be move backwards but you don't give any information about if that happens.

 

Check PBIX file attach.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Wow, Miguel!

 

You really got me started! One question: a need the "average" of all the answers of all patients, eg at baseline, month 3,... Now I see in the graph the answer per patient in the function of baseline, month 3,...

 

eg on our plot I expect baseline 4.5 (= average of all answers at baseline of all patients), 3.0 month 3, ...

 

Michiel

Hi @mthomeer ,

 

the formula calculate the average so if you take the patient from the legend you will get all patients average.

 

Regarding the baseline I'm not sure how you have the data I assumed that the baseline was the first answer from the patient, can you explain how you have the baseline values?


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Hé Miguel

 

I use the data of your Patient_period.pbix file, same table

 

The first answer (=baseline, 01 jan 2020)) of patient A = 5

The first answer (=baseline, 05 feb 2020) of patient B = 4

 

So the average of all the baseline answers = 4.5

That is what I want to see on the graph.

 

Michiel

Hi @mthomeer ,

 

Add the following measure:

AVerage of evaluation = AVERAGEX(VALUES('Table'[PatientID]), [Evaluation])

 

This does the averages of the values per patient of the previous measure:

MFelix_0-1611687871398.png

PBIX file attach.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Tx Miguel

flower.jpg

 

Hi @mthomeer ,

 

Thank you.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.