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
symun23
Frequent Visitor

How to work out the percentage of a column

Hello,

 

So I am trying to work out the percentage of different values in a column.

 

This is the table and I want to know what percentage are 'S1', whenever I have tried to calculate this I get an error message about using a string.

 

IDTYPEMECH
NDPD0424834NSSNS
NDPD0790352S1S1
NDPD0829788S1S1
NDPD0830944S1S1
NDPD1061480S1S1
NDPD1658980S1S1
NDPD1659576NSSS1
NDPD1659692S1S1

 

So in excel I would do something like this =COUNTIF([TYPE],"S1")/COUNTA[ID]*100

The bit I am struggling on is not being able to just focus on the rows with "S1"

1 ACCEPTED SOLUTION

Here is what you need to do : 

 

1 - Add new column with this formula : 

percentage = COUNTROWS(COMPLETE_UPGRADE)/CALCULATE(COUNTROWS(COMPLETE_UPGRADE);ALL(COMPLETE_UPGRADE))

2 - Add a multiple row card

 

3 - Add TYPE

4- Add percentage column (You can choose to display it either as a number either as a percentage. On my screenshot I've choosed the percentage of S1)

 

Et voilà ! Capture.PNG

View solution in original post

3 REPLIES 3
quentin_vigne
Solution Sage
Solution Sage

Hello @symun23

 

Add a multiple row card on your report

 

Add you column TYPE on it

then add a new column : 

 

percentage = COUNTROWS(YOURTABLE)/CALCULATE(COUNTROWS(YOURTABLE);ALL(YOURTABLE))

(replace YOURTABLE by your table name)

 

Then add the column percentage to the multiple row card

 

If you don't understand, give me your table name and I'll do it for you

 

 

Thanks for the reply Quentin,

 

The table name is COMPLETE_UPGRADE

Here is what you need to do : 

 

1 - Add new column with this formula : 

percentage = COUNTROWS(COMPLETE_UPGRADE)/CALCULATE(COUNTROWS(COMPLETE_UPGRADE);ALL(COMPLETE_UPGRADE))

2 - Add a multiple row card

 

3 - Add TYPE

4- Add percentage column (You can choose to display it either as a number either as a percentage. On my screenshot I've choosed the percentage of S1)

 

Et voilà ! Capture.PNG

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.