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! Learn more

Reply
Rob_Morris
Helper I
Helper I

Showing the percentage for row measure for multiple variables in a matrix

I have a matrix to show KPI performance with multiple KPI's (field name = job_kpi) and also whether they have passed or failed each month (this is field name = kpi_check).

 

powerbi kpitable.jpg

 

What I am trying to do is to get the percentage values to display the correct values each month for the pass and fail fields.

So for KPI 1 for April 2021 it would do a calculation for fail of (100/103)*3    but for pass it would do (100/103)*100.

I'm new to power bi / dax so not sure if this is possible - and if so how would I code it so that the figure only looks at the KPI in question, and then does the calculation based on that month only?

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @Rob_Morris ,

According to your description, I create a sample.

vkalyjmsft_0-1648523680700.png

Here's my solution.

Create a measure.

% =
VAR _Parent =
    IF (
        ISFILTERED ( 'Table'[KPI Status] ),
        CALCULATE ( COUNT ( 'Table'[KPI Status] ), ALL ( 'Table'[KPI Status] ) ),
        CALCULATE ( COUNT ( 'Table'[KPI Status] ), ALL ( 'Table'[Job_kpi] ) )
    )
RETURN
    DIVIDE ( COUNT ( 'Table'[KPI Status] ), _Parent )

Get the correct result.

vkalyjmsft_1-1648523788600.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

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

3 REPLIES 3
v-yanjiang-msft
Community Support
Community Support

Hi @Rob_Morris ,

According to your description, I create a sample.

vkalyjmsft_0-1648523680700.png

Here's my solution.

Create a measure.

% =
VAR _Parent =
    IF (
        ISFILTERED ( 'Table'[KPI Status] ),
        CALCULATE ( COUNT ( 'Table'[KPI Status] ), ALL ( 'Table'[KPI Status] ) ),
        CALCULATE ( COUNT ( 'Table'[KPI Status] ), ALL ( 'Table'[Job_kpi] ) )
    )
RETURN
    DIVIDE ( COUNT ( 'Table'[KPI Status] ), _Parent )

Get the correct result.

vkalyjmsft_1-1648523788600.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

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

Brilliant! Thanks for this it's sorted the issue perfectly.

lbendlin
Super User
Super User

Instead of showing as percentage of column total, show as percentage of parent total.

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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