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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
PowerBIUserUKB
New Member

Unable to calculate % of row

Hello,

I'm trying to calculate the percentage value of one column compared to another one.
Here is a table that will illustrate my challenge.

 

PowerBIUserUKB_0-1606478569197.png

 

When II try to achieve this in Power BI I obtain the following:

 

PowerBIUserUKB_1-1606478606067.png

 

I've tried to understand if any filters could be affecting the result but I just cannot get my head around this.

All measures come from the same table.

 

onlyMet = SUMX(FILTER(sla,sla[SLA_MetNumber]=1),sla[SLA_MetNumber])
onlyNotMet = COUNTX(FILTER(sla,sla[SLA_MetNumber]=0),sla[SLA_MetNumber])
onlyTotal = [onlyMet] + [onlyNotMet]
Percent_SLA = CALCULATE([onlyMet] /[onlyTotal])
 
I'm pretty sure I'm missing something fundamental but cannot see it.
Any help would be much appreciated!
 

 

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@PowerBIUserUKB , Prefer using divide

like

Percent_SLA = divide([onlyMet] ,[onlyTotal])

 

Make it decimal with 2 decimal place and Mark as % column (in measure tool)

 

Data Format New Rib.png

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

Thank you very much for the prompt reply; it solved my problem!

So the lack of decimal places rounded up all results to 1?

Is that all that I was missing?

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@PowerBIUserUKB , Prefer using divide

like

Percent_SLA = divide([onlyMet] ,[onlyTotal])

 

Make it decimal with 2 decimal place and Mark as % column (in measure tool)

 

Data Format New Rib.png

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you very much for the prompt reply; it solved my problem!

So the lack of decimal places rounded up all results to 1?

Is that all that I was missing?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.