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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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