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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Measure that counts multiple values and shows as percentage

Hi,

 

Im looking to create a measure to show a percentage of appointments that have either "ATTENDED EARLY" or "ATTENDED IN TARGET".

 

The field has the following appointment outcomes "ATTENDED EARLY", "ATTENDED IN TARGET", "ATTENDED LATE" and  "APPOINTMENT NOT ATTENDED"

 

I have tried the following measure but it isnt working so im expecting im missing something. 

 

Measure = DIVIDE(
 
CALCULATE(COUNTX(FACT_Appt,FACT_Appt[APPOINTMENT SUMMARY] IN {"APPOINTMENT ATTENDED EARLY","APPOINTMENT ATTENDED IN TARGET"})),
CALCULATE(COUNTX(FACT_Appt,FACT_Appt[APPOINTMENT SUMMARY] IN {"APPOINTMENT ATTENDED EARLY","APPOINTMENT ATTENDED IN TARGET","APPOINTMENT ATTENDED IN TARGET","APPOINTMENT ATTENDED LATE","APPOINTMENT NOT ATTENDED"}))
)
 
Any help would be apprechiated
 
Thanks

 

1 ACCEPTED SOLUTION

Hi @Anonymous 

 

Sorry, my bad NOT needs to go before column as in the example below.

No idea why you showing 0 as I can't see your data, can only guess, but you can:

  1. format the measure to %
  2. create a data sample so I can apply the calculation to and test.
Measure 9 = 
DIVIDE( 
    CALCULATE(
        COUNTROWS( 'Product' ),
        'Product'[Color] IN { "Azure" }
    ), 
    CALCULATE(
        COUNTROWS( 'Product' ),
        NOT 'Product'[Color] IN { "Blue" }
    )
)

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

 

View solution in original post

5 REPLIES 5
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

Try this 

Measure = 
DIVIDE(
    CALCULATE(
        COUNTROWS( FACT_Appt ), 
        FACT_Appt[APPOINTMENT SUMMARY] IN { "APPOINTMENT ATTENDED EARLY", "APPOINTMENT ATTENDED IN TARGET"}
    ),
    CALCULATE(
        COUNTROWS( FACT_Appt ), 
        ALL( FACT_Appt )
    )
)

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

 

Anonymous
Not applicable

Hi,

 

Thanks for your help.

 

I tried the measure but added some specific criteria as there are 2 values i want to exclude. I want to exclude "NO APPOINTMENT" and "FUTURE APPOINTMENT". When i try this and place the measure into a Visualisation it shows 0

 

Measure = DIVIDE( CALCULATE( COUNTROWS( FACT_Appt ), FACT_Appt[APPOINTMENT SUMMARY] IN { "APPOINTMENT ATTENDED EARLY", "APPOINTMENT ATTENDED IN TARGET"} ), CALCULATE( COUNTROWS( FACT_Appt ), ALL( FACT_Appt ) ) )

 

 

Any ideas on why this is 0

 

Thanks

 

Hi @Anonymous 

 

You can exclude by using NOT IN{ "value1",  "Value2" } ingstead of IN 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

 

Anonymous
Not applicable

Thanks

 

When i tried the NOT IN it returned a syntax error. Also when i tried your original measure that showed as a 0 aswell

 

This returned an error under the NOT IN function

 

Measure = DIVIDE( CALCULATE( COUNTROWS( FACT_Appt ), FACT_Appt[APPOINTMENT SUMMARY] IN { "APPOINTMENT ATTENDED EARLY", "APPOINTMENT ATTENDED IN TARGET"} ), CALCULATE( COUNTROWS( FACT_Appt ), FACT_Appt[APPOINTMENT SUMMARY] NOT IN {"APPOINTMENT IN FUTURE","NO CURRENT APPT WINDOW"} ) )

 

Hi @Anonymous 

 

Sorry, my bad NOT needs to go before column as in the example below.

No idea why you showing 0 as I can't see your data, can only guess, but you can:

  1. format the measure to %
  2. create a data sample so I can apply the calculation to and test.
Measure 9 = 
DIVIDE( 
    CALCULATE(
        COUNTROWS( 'Product' ),
        'Product'[Color] IN { "Azure" }
    ), 
    CALCULATE(
        COUNTROWS( 'Product' ),
        NOT 'Product'[Color] IN { "Blue" }
    )
)

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors