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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Anonymous
Not applicable

Calculating Percentage

 

GeraldTanwx1990_1-1689871307823.png

 

can anyone point to me where am i wrong? 

i can't seems to get the correct percentage :C 

 

any idea how to share files for others to help troubleshoot? 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Due to I don't know your data model, here I will give you some suggestions.

Count =
IF (
    HASONEVALUE ( 'TableName'[Column in Matrix Column] ),
    DIVIDE (
        DISTINCTCOUNT ( 'UCS_Appointment_Data'[a_centerclientid] ),
        SUM ( 'Enrollment_Numbers'[Enrollment Numbers (including Part time and fill time courses] )
    ),
    DIVIDE (
        CALCULATE (
            DISTINCTCOUNT ( 'UCS_Appointment_Data'[a_centerclientid] ),
            FILTER (
                ALL ( UCS_Appointment_Data ),
                UCS_Appointment_Data[Type of Status] = MAX ( 'TableName'[Column in Matrix Row] )
            )
        ),
        CALCULATE (
            SUM ( 'Enrollment_Numbers'[Enrollment Numbers (including Part time and fill time courses] ),
            FILTER (
                ALL ( 'Enrollment_Numbers' ),
                'Enrollment_Numbers'[Type of Status] = MAX ( 'TableName'[Column in Matrix Row] )
            )
        )
    )
)

If this reply still couldn't help you solve your issue, please share a sample file with me.

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
flath
Helper II
Helper II

Hi,

Maybe it's not working due to row/filter context.

Try this:




Measure = 
VAR UCS = DISTINCTCOUNT('UCS_Appointment_Data'[a_centerclientid])
VAR Enrollment  = SUM('Enrollment_Numbers'[Enrollment Numbers (including Part time and fill time courses])
return DIVIDE(UCS, Enrollment)

Obs.: Please, spell check the names of tables and columns 'cause I may have misspelled something.

Anonymous
Not applicable

Thanks for the prompt reply!!!
it yield the same results.

 

i think i know what is the error, but i cannot seem to solve it.

the denominator is always fixed. Any idea how to solve this ? 

GeraldTanwx1990_0-1689873173803.png

 

Now it looks you'll need to fix the relationship between tables.
I think maybe the field that contains the data "2020/2021, 2021/2022, 2022/2023"... can't find a relationship beteween both tables.

In my models, when I have a situation like that I find useful to create a composite key on both tables e create a relationship using this composite key.


Anonymous
Not applicable

i managed to do up the data, but i don't understand what i did.

GeraldTanwx1990_0-1689903270877.png

 

i only ticked the check box "apply filter in both directions".
Do you have any idea what it mean? 😐 Many thanks for your prompt advice! 

Anonymous
Not applicable

Hi @Anonymous ,

 

Due to I don't know your data model, here I will give you some suggestions.

Count =
IF (
    HASONEVALUE ( 'TableName'[Column in Matrix Column] ),
    DIVIDE (
        DISTINCTCOUNT ( 'UCS_Appointment_Data'[a_centerclientid] ),
        SUM ( 'Enrollment_Numbers'[Enrollment Numbers (including Part time and fill time courses] )
    ),
    DIVIDE (
        CALCULATE (
            DISTINCTCOUNT ( 'UCS_Appointment_Data'[a_centerclientid] ),
            FILTER (
                ALL ( UCS_Appointment_Data ),
                UCS_Appointment_Data[Type of Status] = MAX ( 'TableName'[Column in Matrix Row] )
            )
        ),
        CALCULATE (
            SUM ( 'Enrollment_Numbers'[Enrollment Numbers (including Part time and fill time courses] ),
            FILTER (
                ALL ( 'Enrollment_Numbers' ),
                'Enrollment_Numbers'[Type of Status] = MAX ( 'TableName'[Column in Matrix Row] )
            )
        )
    )
)

If this reply still couldn't help you solve your issue, please share a sample file with me.

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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
Top Kudoed Authors