This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
I need help in creating measure, I have 3 tables 1) Patient Name 2) Patient Diagnosis 3) Medicene Consumed. I have linked diagnosis and medicene table with Patient Name table via ID. Now I want a measure which can calculate that how many patients are diagnosed as "Fever" and consumed "Panadol" and "Arinac". Below are the tables for reference in this case answer is 2, Patient with ID 1 and 5 are Diagnosed as Fever and Consumed "Panadol" and "Arinac". How can I achieve this via measure.
Patient Name:
| ID | Name |
| 1 | Ahmed |
| 2 | Rafiq |
| 3 | Saleem |
| 4 | Jospeh |
| 5 | David |
Patient Diagnosis:
| ID | Diagnosis |
| 1 | Fever |
| 2 | Flu |
| 3 | Flu |
| 4 | Flu |
| 5 | Fever |
Medicene Consumed:
| ID | Medicine Name |
| 1 | Panadol |
| 1 | Brufen |
| 1 | Arinac |
| 2 | Panadol |
| 2 | Arinac |
| 3 | Panadol |
| 4 | Panadol |
| 5 | Panadol |
| 5 | Arinac |
Solved! Go to Solution.
Hi , @TSK
You may check if the following measure helps.
Measure 1 =
VAR tab =
SUMMARIZE (
'Patient Name',
'Patient Name'[ID],
'Patient Name'[Name],
"flag",
VAR _id = [ID]
RETURN
IF (
LOOKUPVALUE ( 'Patient Diagnosis'[Diagnosis], 'Patient Diagnosis'[ID], _id ) = "Fever"
&& "Arinac" IN DISTINCT ( 'Medicene Consumed'[Medicine Name] )
&& "Panadol" IN DISTINCT ( 'Medicene Consumed'[Medicine Name] ),
1,
0
)
)
RETURN
SUMX ( tab, [flag] )
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi , @TSK
You may check if the following measure helps.
Measure 1 =
VAR tab =
SUMMARIZE (
'Patient Name',
'Patient Name'[ID],
'Patient Name'[Name],
"flag",
VAR _id = [ID]
RETURN
IF (
LOOKUPVALUE ( 'Patient Diagnosis'[Diagnosis], 'Patient Diagnosis'[ID], _id ) = "Fever"
&& "Arinac" IN DISTINCT ( 'Medicene Consumed'[Medicine Name] )
&& "Panadol" IN DISTINCT ( 'Medicene Consumed'[Medicine Name] ),
1,
0
)
)
RETURN
SUMX ( tab, [flag] )
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Want to ask one more thing, if I have lots of kind of fever like, fever dengue, fever malaria, fever covid, in that case how can I catch any diagnosis which contains the word fever rather than hard coded "Fever"
Thank you, You are awesome.
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 11 | |
| 10 | |
| 7 | |
| 7 | |
| 7 |
| User | Count |
|---|---|
| 28 | |
| 25 | |
| 22 | |
| 21 | |
| 21 |