Forum Discussion
Anonymous
7 years agoNot applicable
How to count distinct values in a column?
Hello, How can I count only the "1" in al column. The column has 3 different values: 1, [Empty] and -1. I need it to make a measure: percentage of the "1" of the total (1 and -1). Thank...
- 7 years ago
There are several ways.
I'd probably use...
=COUNTROWS(FILTER(Table, [Column]=1))
- 7 years ago
Hi Anonymous,
You can use the following measure for count
Count1 = CALCULATE(COUNT(Table1[Column1]),FILTER(Table1,Table1[Column1]=1))
For calculating the percent you can use the following measure
Percent = var rowsc=COUNTROWS(Table1) return CALCULATE([Count1]/rowsc)*100
You can view the pbix file here
If this helped you, please mark this post as an accepted solution and like to give KUDOS .
Regards,
Affan
affan
Solution Sage
7 years agoHi Anonymous,
You can use the following measure for count
Count1 = CALCULATE(COUNT(Table1[Column1]),FILTER(Table1,Table1[Column1]=1))
For calculating the percent you can use the following measure
Percent = var rowsc=COUNTROWS(Table1) return CALCULATE([Count1]/rowsc)*100
You can view the pbix file here
If this helped you, please mark this post as an accepted solution and like to give KUDOS .
Regards,
Affan