Forum Discussion
v-chihyu
Microsoft Employee
6 years agocount category column and divide it
hi I am very new to this. I need to count each item in the category and divide by total number. Category Watermelon Banana Apple it's simple, but I just couldn't make it calculate...
- Anonymous6 years ago
Hi v-chihyu ,
It seems like you just want to calculate the count of Mineral / total count,right?
You could try to use the following formula:
JustForMineral = CALCULATE ( COUNTROWS ( 'Table' ), FILTER ( ALL ( 'Table' ), 'Table'[filtration] = "mineral" ) ) / CALCULATE ( COUNTROWS ( ALL ( 'Table' ) ) )In case you want to calculate each value in Filtration column, use this:
eachFiltration = CALCULATE ( COUNTROWS ( 'Table' ), ALLEXCEPT ( 'Table', 'Table'[filtration] ) ) / CALCULATE ( COUNTROWS ( ALL ( 'Table' ) ) )My visual looks like this:
Did I answer your question? Please mark my reply as solution ~
Best Regards,
Eyelyn Qin
v-chihyu
Microsoft Employee
6 years agoThis is great, the first one is exactly the one what I need.