Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
I'm trying to count the number of times a measure is true across N amount of vendors:
% Compliant =
DIVIDE(SUM('STP_HEDIS_CUR'[COMPLIANT_CNT]),SUM('STP_HEDIS_CUR'[ELIGIBLE_CNT]))
Pretty straighfoward, which yields this table:
Next I'm trying to count the number of times that measure is true (e.g. shaded green) but I'm getting the message in the title of the post. I tried the below formula:
VendorCount =
CALCULATE (
COUNT ('STP_ALL_MBRS'[VENDOR]),
FILTER (
ALL ('STP_ALL_MBRS'[VENDOR]),
'STP_ALL_MBRS'[VENDOR] > (STP_HEDIS_CUR[% Compliant] >= AVERAGE(STP_HEDIS_CUR[STAR4_CUTPOINT_OPTION1]))
)
)
Solved! Go to Solution.
The issue is this line
'STP_ALL_MBRS'[VENDOR] > (STP_HEDIS_CUR[% Compliant] >= AVERAGE(STP_HEDIS_CUR[STAR4_CUTPOINT_OPTION1]))
What this is effectively doing is this
"a" > true/false
which will give you the error you have as you are comparing different data types.
You can't compare a text value to a boolean or numerical value so you need to rewrite that line to make sense.
Regards
Phil
Proud to be a Super User!
It turns out I had a typo (that first > was supposed to be a ",") which threw the error, but even so my formula was counting members not measures. This is what I needed:
CALCULATE (
DISTINCTCOUNT(STP_HEDIS_CUR[MEASURE_DESC]),
FILTER (
ALL (STP_HEDIS_CUR[MEASURE_DESC]),
STP_HEDIS_CUR[% Compliant] >= AVERAGE(STP_HEDIS_CUR[STAR4_CUTPOINT_OPTION1])
)
)
It's still incorrectly counting everything, but I'm pretty sure it's a de-duping issue from the source. Thank you for making me think this one through 😀.
It turns out I had a typo (that first > was supposed to be a ",") which threw the error, but even so my formula was counting members not measures. This is what I needed:
CALCULATE (
DISTINCTCOUNT(STP_HEDIS_CUR[MEASURE_DESC]),
FILTER (
ALL (STP_HEDIS_CUR[MEASURE_DESC]),
STP_HEDIS_CUR[% Compliant] >= AVERAGE(STP_HEDIS_CUR[STAR4_CUTPOINT_OPTION1])
)
)
It's still incorrectly counting everything, but I'm pretty sure it's a de-duping issue from the source. Thank you for making me think this one through 😀.
The issue is this line
'STP_ALL_MBRS'[VENDOR] > (STP_HEDIS_CUR[% Compliant] >= AVERAGE(STP_HEDIS_CUR[STAR4_CUTPOINT_OPTION1]))
What this is effectively doing is this
"a" > true/false
which will give you the error you have as you are comparing different data types.
You can't compare a text value to a boolean or numerical value so you need to rewrite that line to make sense.
Regards
Phil
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
192 | |
79 | |
70 | |
50 | |
42 |