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.
I have 2 columns 'Total OPD Visits' and 'EMR Filled'. I must calculate 'EMR Usage %' as 'EMR Filled'/Total OP Visits'.
Here's how my matrix is set up:
The numbers on the 'Practitioner' level are correct. However, on the specialty level, it is just adding (or averaging) the practitioner-level numbers.
SPECIALTY:
PRACTITIONER:
Currently set to average.
I want the specialty numbers to be the correct division, i.e. [EMR FILLED (for all practitioners under that specialty)] / [TOTAL OPD VISITS (for all practitioners under that specialty)].
I have tried various solutions presented by the community on similar issues:
EMR USAGE DETAIL% =
DIVIDE (
CALCULATE (
SUM ( Detail_Conversion_Report[EMR_Filled] ),
ALL ( Detail_Conversion_Report[Specialty], Detail_Conversion_Report[Practitioner] )
)
,
CALCULATE (
SUM ( Detail_Conversion_Report[Total_OPD_Visits] ),
ALL ( Detail_Conversion_Report[Specialty], Detail_Conversion_Report[Practitioner] )
),
0
)
// SUM('Detail_Conversion_Report'[EMR_Filled])/SUM('Detail_Conversion_Report'[Total_OPD_Visits])
// CALCULATE(DIVIDE(Detail_Conversion_Report[EMR_FILLED_MEASURE], Detail_Conversion_Report[TOTAL_OPD_MEASURE]),
// ALLSELECTED(Detail_Conversion_Report[Specialty]))
// CALCULATE(DIVIDE(Detail_Conversion_Report[EMR_FILLED_MEASURE], Detail_Conversion_Report[TOTAL_OPD_MEASURE]),
// ALLSELECTED(Detail_Conversion_Report[Practitioner], Detail_Conversion_Report[Specialty]))
// IF(HASONEFILTER(Detail_Conversion_Report[Practitioner]),
// CALCULATE(
// [EMR_FILLED_MEASURE],
// ALL(Detail_Conversion_Report[Specialty])
// )
// /
// CALCULATE(
// [TOTAL_OPD_MEASURE],
// ALL(Detail_Conversion_Report[Specialty])
// )
// ,
// DIVIDE(Detail_Conversion_Report[EMR_FILLED_MEASURE], Detail_Conversion_Report[TOTAL_OPD_MEASURE])
// )
// IF(HASONEFILTER(Detail_Conversion_Report[Specialty]),
// DIVIDE(Detail_Conversion_Report[EMR_FILLED_MEASURE], Detail_Conversion_Report[TOTAL_OPD_MEASURE]),
// CALCULATE(
// [EMR_FILLED_MEASURE],
// ALL(Detail_Conversion_Report[Specialty])
// )
// /
// CALCULATE(
// [TOTAL_OPD_MEASURE],
// ALL(Detail_Conversion_Report[Specialty])
// )
// )
// DIVIDE(Detail_Conversion_Report[EMR_FILLED_MEASURE], Detail_Conversion_Report[TOTAL_OPD_MEASURE])
// IF (
// ISFILTERED (Detail_Conversion_Report[Practitioner]),
// Detail_Conversion_Report[EMR_FILLED_MEASURE]
// /
// CALCULATE (
// DIVIDE(Detail_Conversion_Report[EMR_FILLED_MEASURE], Detail_Conversion_Report[TOTAL_OPD_MEASURE]),
// ALL (Detail_Conversion_Report[Practitioner])
// )
// )
// IF (
// NOT(ISFILTERED (Detail_Conversion_Report[Specialty])),
// CALCULATE(
// [EMR_FILLED_MEASURE],
// ALL(Detail_Conversion_Report[Specialty])
// )
// /
// CALCULATE(
// [TOTAL_OPD_MEASURE],
// ALL(Detail_Conversion_Report[Specialty])
// )
// )
// IF(
// Detail_Conversion_Report[Total_OPD_Visits] = 0,
// 0,
// Detail_Conversion_Report[EMR_Filled] / Detail_Conversion_Report[Total_OPD_Visits]
// )
Solved! Go to Solution.
Hi @Aretehealth,
For measure expression get the wrong result when calculated on the total level with multiple aggregations, you can take a look at the following blog to know how to handle this scenario:
Measure Totals, The Final Word
Regards,
Xiaoxin Sheng
Hi @Aretehealth,
For measure expression get the wrong result when calculated on the total level with multiple aggregations, you can take a look at the following blog to know how to handle this scenario:
Measure Totals, The Final Word
Regards,
Xiaoxin Sheng
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 |
---|---|
108 | |
106 | |
87 | |
77 | |
69 |
User | Count |
---|---|
124 | |
112 | |
94 | |
84 | |
75 |