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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
mbailey
Helper II
Helper II

How to calculate the percentage of total items using the count of a group

I'm trying to figure out how to calculate the percentage of total items the count of a group is. Example data below. Each contract can have one of several possible serv_type values. In the example below there are 15 total items and 7 of them are FS.  So the FS's are .46 % of the total count (7/15).

 

I'm using a Direct Query so I can create another intermediary table for this.  Ultimately I'd like to create a visualization showing the resulting percent of total items for each serv_type group. 

 

contract | serv_type
16718 | FS
16716 | FS
16715 | PM3
16713 | FS
16712 | FS
16711 | FS
16710 | FS
16709 | FS
16708 | WA
16707 | WAP
16706 | WA
16705 | PM3
16704 | WAP
16703 | WA
16702 | WA

 

Thanks,

Mike

7 REPLIES 7
hthota
Resolver III
Resolver III

Report Pic:

mbailey.PNG

hthota
Resolver III
Resolver III

Hi,

 

This link doesn't work for me. It just keeps "spinning" saying Working/Loading.

 

Mike

Is it the requriment you need.

Yes, but the link you sent explaining how to do it doesn't work.

 

Mike

Get the file from this Link.

 

I hope i would help you.

Link: https://drive.google.com/open?id=1XE9NBo03E8zRsJe3F7AliGMxjXPwrO4o

Hi,

 

Thank you for sharing your report, but unfortunately, that will not work.  First, as I mentioned, I'm using a Direct Query - connected to a database with live data that constantly changes. In your example, you created a table with two extra columns that I don't have - Count, and Total Type Count. PB will also not net you create additional "work" tables when your starting source is a Direct Query. I also can not create additional columns. You get the error "Function 'COUNT' is not allowed as part of a calculated column DAX expressions on DirectQuery models."

 

I need some kind of formula/measure that will first group and then return the count of each serv_type.  I can then use that to calculate the percentage.  In plain language: DIVIDE( the count of serv_type grouped by serv_type, the total Contracts count)

 

Mike

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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