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
jayasurya_prud
Helper II
Helper II

Calculation in table

I have a table with me which has a column of category names. I need to get the count of every category and the percentage of the category with total in a visual table/matrix. For example, like this

ProductsnosPercent
A318.75%
B425.00%
C318.75%
D318.75%
E318.75%
Total16100.00%


Please guide me with a solution

1 ACCEPTED SOLUTION

Sorry, I thought "nos" was an actual field. 
Try:

Count Products = 
COUNT('Table'[PRODUCTS])
% Over totals =
DIVIDE (
    [Count Products],
    CALCULATE ( [Count Products], ALL ( 'Table'[PRODUCTS] ) )
)

count.png

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

6 REPLIES 6
PaulDBrown
Community Champion
Community Champion

The ID column will not affect the calculations 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






jayasurya_prud
Helper II
Helper II

Thanks a lot for the solution.

PaulDBrown
Community Champion
Community Champion

Try

% over total =
DIVIDE (
    SUM ( Table[nos] ),
    CALCULATE ( SUM ( Table[nos] ), ALL ( Table[Products] ) )
)




Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Hi, Why should I need to do sum? I need the count value. 

the nos column is the count of every category.

 

 

lets say that my column is like this 

 

PRODUCTS
A
A
A
B
B
B
B
C
C
C
D
D
D
E
E
E

 

from this, I wan to get the count of every category and also the percentage.  like this in table / matrix visual

 

ProductsnosPercent
A318.75%
B425.00%
C318.75%
D318.75%
E318.75%
Total16100.00%

Sorry, I thought "nos" was an actual field. 
Try:

Count Products = 
COUNT('Table'[PRODUCTS])
% Over totals =
DIVIDE (
    [Count Products],
    CALCULATE ( [Count Products], ALL ( 'Table'[PRODUCTS] ) )
)

count.png

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






This helps a lot. But I got another doubt. What if I have ID column which has duplicate values like this

idPRODUCTS
1A
1A
2A
2B
3B
3B
4B
5C
6C
7C
8D
8D
9D
10E
11E
12E

 

if this is the table, I should be doing  distinct count ?

 

please guide me with a logic

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.