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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
rickmarques
Frequent Visitor

Help with figuring/creating a measure

Hello,

 

I'm inexperienced with PBI and I'm trying to create a percentage value in a matrix visual.

 

The DB data is something like this:

IDdetailssla met
1problem1        0
2problem2        1
3problem2        1
4problem1        1
5problem3        0
6problem3        0

 

The matrix I'm using has the 'details' as rows, the 'sla met' as columns and the count of 'sla met' as values, showing something like:

details01total
problem1  1  1  2
problem2   2  2
problem3  2   2

 

What I need to have is a measure that divides value in the '1' column by the total, so i can have a percentage of '1' column vs. total.

 

Is there a way of doing this? I'm using PBI service included in Microsoft Fabric.

 

Thanks in advance.

1 ACCEPTED SOLUTION
Martin_D
Super User
Super User

Hi 

 

The easiest way would be to right-click on the field in the values configuration of the matrix visual and choose display as percentage of row as described here: https://www.popautomation.com/post/power-bi-percentage-of-total#:~:text=identify%20a%20calculation.-...

 

Martin_D_0-1702569692083.png

 

If you want to write a measure, this would be the code:

Pct. SLA Met =
VAR _SlaCountInContext =
    COUNTROWS ( Table )
VAR _SlaCountAll =
    CALCULATE (
        COUNTROWS ( Table ),
        REMOVEFILTERS (Table[sla met] )
)
RETURN

DIVIDE ( _SlaCountInContext, _SlaCountAll )

BR

Martin

View solution in original post

1 REPLY 1
Martin_D
Super User
Super User

Hi 

 

The easiest way would be to right-click on the field in the values configuration of the matrix visual and choose display as percentage of row as described here: https://www.popautomation.com/post/power-bi-percentage-of-total#:~:text=identify%20a%20calculation.-...

 

Martin_D_0-1702569692083.png

 

If you want to write a measure, this would be the code:

Pct. SLA Met =
VAR _SlaCountInContext =
    COUNTROWS ( Table )
VAR _SlaCountAll =
    CALCULATE (
        COUNTROWS ( Table ),
        REMOVEFILTERS (Table[sla met] )
)
RETURN

DIVIDE ( _SlaCountInContext, _SlaCountAll )

BR

Martin

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.