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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
jwesle
Frequent Visitor

Finding Percent of Total within Table

Hello, I am having difficulty determining how to find a % of total values based on multiple criteria within one table. The data table contains a Cust ID column, a Location Column, and an Item ID column. It's difficult to put into words, but I am trying to determine the percentage of items that are within each Cust ID and Location pairing (each Cust ID would add up to 100%). Example: For Cust ID 20001, there are six total items. One in Location 12 (17%), 2 in Location 14 (33%), and three in Location 20 (50%).

 

Raw Data:

Cust IDLocationItem ID
20001121
20001142
20001143
20001204
20001205
20001206
35000127
35000128
35000149
350001410
350001411

 

Desired Output:

Cust IDLocation% of ID/Loc
200011217%
200011433%
200012050%
350001240%
350001460%

 

Is there any way to create this view?

 

Thanks!

1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

Hi @jwesle

 

Try this, where Table1 is the name of the table shown

 

1. Set Table1[Cust ID] and Table1[Location] in the rows of a matrix visual 

2. Set this measure in values of the matrix visual:

 

 

Percentage of ID/Loc =
DIVIDE (
    COUNT ( Table1[Item ID] ),
    CALCULATE ( COUNT ( Table1[Item ID] ), ALL ( Table1[Location] ) )
)

 

View solution in original post

2 REPLIES 2
AlB
Community Champion
Community Champion

Hi @jwesle

 

Try this, where Table1 is the name of the table shown

 

1. Set Table1[Cust ID] and Table1[Location] in the rows of a matrix visual 

2. Set this measure in values of the matrix visual:

 

 

Percentage of ID/Loc =
DIVIDE (
    COUNT ( Table1[Item ID] ),
    CALCULATE ( COUNT ( Table1[Item ID] ), ALL ( Table1[Location] ) )
)

 

jwesle
Frequent Visitor

Thank you. I was able to get it to work using the code below.

 

Much appreciated.

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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