Forum Discussion
jayasurya_prud
4 years agoAdvocate III
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 ...
- 4 years ago
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] ) ) )
PaulDBrown
4 years agoCommunity Champion
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] ) )
)
jayasurya_prud
4 years agoAdvocate III
This helps a lot. But I got another doubt. What if I have ID column which has duplicate values like this
| id | PRODUCTS |
| 1 | A |
| 1 | A |
| 2 | A |
| 2 | B |
| 3 | B |
| 3 | B |
| 4 | B |
| 5 | C |
| 6 | C |
| 7 | C |
| 8 | D |
| 8 | D |
| 9 | D |
| 10 | E |
| 11 | E |
| 12 | E |
if this is the table, I should be doing distinct count ?
please guide me with a logic