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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
samc_26
Helper II
Helper II

Percentage breakdown by category with sum

Hi, I'm trying to work out some percentages and not getting very far. I have two tables which looks something like this:

(have changed data details for privacy)

 

Capacity table

CountyAreaTotal Capacity
YorkshireLeeds7,200
YorkshireYork3,360
LondonEssex48,000
DerbyshireBakewell10,000
DerbyshireChesterfield10,000
LancashirePreston40,000
LancashireManchester60,000

 

Availability table

DateCountyAreaAvailability
01/01/25YorkshireLeeds

1

01/01/25YorkshireYork0
01/01/25LondonEssex1
01/01/25DerbyshireBakewell1
01/01/25DerbyshireChesterfield0
01/01/25LancashirePreston1
01/01/25LancashireManchester0

 

I don't have this table but this is the first part of the calculation I need it to do somehow

 

CountyAreaCapacityAvailabilityPercentage 
YorkshireLeeds7,200168%
YorkshireYork3,360032%
LondonEssex48,0001100%
DerbyshireBakewell10,000150%
DerbyshireChesterfield10,000050%
LancashirePreston40,000140%
LancashireManchester60,000060%

 

I need the final table to show something like this, so it sums up the percentage availability if the availability equals a '1'.

 

CountyPercentage total (availability)
Yorkshire68%
London100%
Derbyshire50%
Lancashire40%

 

Up to now all I've managed to do is calculate a percentage by area across all the areas which isn't any help for my future calculation I need to do. Any help would be greatly appreciated! 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@samc_26 , You can have Column like

 


divide(
sumx(filter( Capacity , Capacity[County] = Availability[County] && Capacity[Area]= Availability[Area] ) , Capacity[Total Capacity]) ,

sumx(filter( Capacity , Capacity[County] = Availability[County] ) , Capacity[Total Capacity]))

and in visual filter that with availability

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

4 REPLIES 4
Uzi2019
Super User
Super User

Hi @samc_26 

Do you want this table exactly???

 

Uzi2019_0-1738237056833.png

 

 

Or you want % bifurcation across countries if availability =1???

 

please provide expected output ..

 

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Yes please 😁

amitchandak
Super User
Super User

@samc_26 , You can have Column like

 


divide(
sumx(filter( Capacity , Capacity[County] = Availability[County] && Capacity[Area]= Availability[Area] ) , Capacity[Total Capacity]) ,

sumx(filter( Capacity , Capacity[County] = Availability[County] ) , Capacity[Total Capacity]))

and in visual filter that with availability

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

That's brilliant, I was a bit stuck but realised how it works now, thank you!

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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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