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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
lscoffield
Frequent Visitor

Calculate percentage of total for column

I have a table that I am reporting on that includes a column IsEmployed. The chart shows those employed (green) and not employed (red) for each year. 

 

 

employed.PNG

I would like to display a percentage employed in each column for each year. Is this possible with Power bi? 

 

3 ACCEPTED SOLUTIONS
Vvelarde
Community Champion
Community Champion

@lscoffield

 

Hi, try with this (modified accord to your tables and Fields)

 

%byType =
DIVIDE (
    CALCULATE ( COUNT ( Table1[Employee] ) ),
    CALCULATE ( COUNT ( Table1[Year] ), ALLSELECTED ( Table1[Employee] ) )
)

img1.png

Regards

 

Victor

Lima - Peru




Lima - Peru

View solution in original post

How did you get the value to show in the column?

View solution in original post

@lscoffield

 

Format Panel - Data Label ON.

 

img2.png




Lima - Peru

View solution in original post

4 REPLIES 4
Vvelarde
Community Champion
Community Champion

@lscoffield

 

Hi, try with this (modified accord to your tables and Fields)

 

%byType =
DIVIDE (
    CALCULATE ( COUNT ( Table1[Employee] ) ),
    CALCULATE ( COUNT ( Table1[Year] ), ALLSELECTED ( Table1[Employee] ) )
)

img1.png

Regards

 

Victor

Lima - Peru




Lima - Peru

How did you get the value to show in the column?

@lscoffield

 

Format Panel - Data Label ON.

 

img2.png




Lima - Peru
jthomson
Solution Sage
Solution Sage

I can't see an obvious way to do this simply (unless you're happy for it to be a tooltip), you could try working around it by making a measure that calculates your percentage, adding that as another value to your chart, then setting your percentage to the same colour as the chart background (so it doesn't show up) and customising the data labels so that your employed/unemployed labels are turned off but your percentage is turned on.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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